Skip to content

fix(ai-agents): preserve shell script permissions on init - #9280

Merged
huimiu merged 2 commits into
mainfrom
glharper/9257-preserve-shell-permissions
Jul 24, 2026
Merged

fix(ai-agents): preserve shell script permissions on init#9280
huimiu merged 2 commits into
mainfrom
glharper/9257-preserve-shell-permissions

Conversation

@glharper

Copy link
Copy Markdown
Member

Summary

  • write downloaded .sh files with executable permissions during azd ai agent init
  • apply the same behavior to GitHub CLI and direct GitHub API download paths
  • reapply executable permissions when an existing shell script is overwritten

Testing

  • go test ./internal/cmd -count=1
  • go build ./...
  • golangci-lint run ./internal/cmd/...
  • cspell lint internal/cmd/init.go internal/cmd/init_test.go

Fixes #9257

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fed9e97b-e79b-4889-ac76-0d9a428599cd
Copilot AI review requested due to automatic review settings July 23, 2026 14:34
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag @RickWinter and @kristenwomack to let us know.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures AI agent initialization preserves executable permissions for downloaded shell hooks.

Changes:

  • Centralizes downloaded-file writes with extension-based permissions.
  • Restores executable mode when overwriting .sh files.
  • Adds cross-platform permission tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/cmd/init.go Applies executable permissions to downloaded shell scripts.
internal/cmd/init_test.go Tests content replacement and file modes.

@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jul 23, 2026
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init.go Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 21:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init.go
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_test.go
@huimiu
huimiu merged commit f98dfa0 into main Jul 24, 2026
30 checks passed
trangevi added a commit that referenced this pull request Jul 30, 2026
…leases (#9371)

* chore: prepare azure.ai.agents 1.0.0-beta.8 release

Bump version and add changelog for 10 PRs since beta.7:
- Features: max_stalls early-stopping (#9314), invocations protocol 2.0.0 default (#9327)
- Bug fixes: #9365, #9328, #9291, #9290, #9212, #9211, #9280, #9237

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* chore: prepare azure.ai.projects 1.0.0-beta.4 release

Bump version and add changelog for 1 PR since beta.3:
- Bug fix: cap Foundry ARM deployment names to 64 chars (#9292)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: add imatiach to cspell contributor aliases

Fix cspell-ext CI gate failure for the azure.ai.agents CHANGELOG entry
referencing @imatiach-msft (PR #9314).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sh files are not sent as executables in the azd hooks.

4 participants