Skip to content

feat: Expose branch.base_ref and branch.ref_type to env variables#1836

Open
Vitor-Avila wants to merge 1 commit into
mainfrom
feat/expose-base-refs
Open

feat: Expose branch.base_ref and branch.ref_type to env variables#1836
Vitor-Avila wants to merge 1 commit into
mainfrom
feat/expose-base-refs

Conversation

@Vitor-Avila

Copy link
Copy Markdown
Contributor

Summary

Exposing branch's base_ref and ref_type as environment variables that can be used in .agor.yml files.

Why / context

This is pretty useful to orchestrate environment deployment through Codespaces with Agor. When you create a new branch in Agor, that branch doesn't yet exist upstream. That said, trying to spin up Codespaces would fail. This feature allows to configure the env to start pointing to the base branch (that exists upstream). For example:

gh cs create -R "$REPO" -b "$BASE_BRANCH" -d "$DISPLAY" \
  --devcontainer-path "$DEVCONTAINER" \
  -l "$LOCATION" -m "$MACHINE" \
  --idle-timeout "$IDLE_TIMEOUT" --retention-period "$RETENTION" \
  --default-permissions

Implementation notes

Might not be super widely adopted, but not a big change either. Just expanding the existing framework.

Validation / test plan

  • pnpm test
  • pnpm typecheck
  • Manual validation

Screenshots / demos

No meaningful UI changes.

Risks / rollout / rollback

No risks.

Out of scope / follow-ups

Thought about using the {{custom.*}} branch properties. It doesn't have a native UI editor, so you must go through MCP change. Also feels like a natural feature.

@richardfogaca richardfogaca 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.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants