Skip to content

🐛 (patch) Continue existing API docs branches instead of pulling them - #133

Merged
kammce merged 1 commit into
mainfrom
api-deploy-existing-branch
Oct 26, 2026
Merged

kammce merged 1 commit into
mainfrom
api-deploy-existing-branch

Conversation

@kammce

@kammce kammce commented Oct 26, 2026

Copy link
Copy Markdown
Member

Fixes the 📚 Deploy APIs runs that fail at "Deploy to API repo" with a non-fast-forward push. libhal and libhal-arm-mcu both fail this way on main right now.

Cause

api_deploy.py cloned libhal/api, created the docs branch from main, then ran git pull origin <branch>.

Change

  • If origin/<branch> exists, the script checks it out and commits on top, so the push is a fast-forward.
  • If it doesn't exist, the branch starts from main as before.
  • Being behind main doesn't matter for the docs PR, since each repository's docs live in their own directory.

Testing

I tested locally against a bare repo set up the way libhal/api is now: a docs branch one commit behind a main that moved on. The GitHub URL and API calls were stubbed out.

  • The old script fails with the same non-fast-forward rejection as CI.
  • The new script commits on top of the existing branch and pushes.
  • For a repository with no docs branch, the new script starts from main and pushes.

api_deploy.py made the docs branch from main and then pulled the remote
branch into it. Once main has a commit the branch lacks, such as another
repository's merged docs, the pull fails on divergent branches. The
script reported that as a missing branch, committed on top of main and
the push was rejected as non-fast-forward.

It now checks out origin/<branch> when it exists and only starts from
main for a new branch.

@kammce kammce left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

@kammce
kammce merged commit d668665 into main Oct 26, 2026
24 checks passed
@kammce
kammce deleted the api-deploy-existing-branch branch October 26, 2026 13:59
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.

1 participant