feat: add git metadata to deploys via v1alpha1 API by jlaneve · Pull Request #1990 · astronomer/astro-cli

and others added 2 commits

December 15, 2025 14:17
Add support for including git metadata (commit SHA, branch, author, etc.)
in deploy requests. This uses the v1alpha1 API which supports the git
metadata field, providing better traceability for deployments.

Changes:
- Add `deploy.git_metadata` config option (default: true)
- Add `ASTRO_DEPLOY_GIT_METADATA` env var support
- Add `createDeployWithGit()` function using v1alpha1 API
- Reuse existing `retrieveLocalGitMetadata()` from bundle deploys
- Fall back to git commit message for deploy description if not provided

When enabled (default), deploys will:
- Include git metadata (provider, account, repo, branch, commit SHA, URL, author)
- Auto-populate description from commit message if not specified
- Skip git metadata if repository has uncommitted changes

Users can opt out by setting `deploy.git_metadata: false` in config
or `ASTRO_DEPLOY_GIT_METADATA=false` environment variable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add commit message fallback for description even when git metadata is disabled
- Disable git metadata in deploy tests to preserve existing mock behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use astrocore.CreateDeployRequestType constants (DAG, IMAGE) instead of
raw strings for better type safety.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove the config flag approach and update the deploy implementation
to use v1beta1 API exclusively with git metadata support. This requires
the backend changes from astro PR #35907 which adds git metadata support
to the v1beta1 CreateDeploy endpoint.

Changes:
- Regenerate astro-client-platform-core with git metadata types
- Update Deploy() to use v1beta1 CreateDeployWithResponse with git metadata
- Remove v1alpha1 code path and createDeployWithGit function
- Remove DeployGitMetadata config flag
- Fix IsHibernating pointer type change from client regeneration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add configuration to enable/disable git metadata in deploys:
- Add `deploy.git_metadata` config option (default: true)
- Add `ASTRO_DEPLOY_GIT_METADATA` env var for CI/CD overrides
- Add tests for config and env var functionality

Users can opt out of git metadata via:
  astro config set deploy.git_metadata false
  ASTRO_DEPLOY_GIT_METADATA=false astro deploy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…e.go

- Use dynamic provider instead of hardcoded GITHUB in deploy.go
- Use pre-computed CommitUrl in bundle.go instead of reconstructing it
- Consistent field ordering in both files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

@jlaneve @claude

@jlaneve jlaneve marked this pull request as ready for review

December 18, 2025 18:36

neel-astro

@jlaneve @claude

Address PR review feedback:
- Remove env var override for git metadata config (users can use
  `astro config set -g deploy.git_metadata false` instead)
- Revert intermediate imageRepository variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>