Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow self-referential branch start points #555

Open
epompeii opened this issue Jan 21, 2025 · 0 comments
Open

Allow self-referential branch start points #555

epompeii opened this issue Jan 21, 2025 · 0 comments

Comments

@epompeii
Copy link
Member

epompeii commented Jan 21, 2025

Currently, self-referential branch start points do not work properly. This can be useful if a user accidentally resets their branch start point and they wish to move back to a prior start point.

Message: Head Version (...) not found: Record not found
Head Version may be private and require authentication or it may not exist.
Expected format is `Authorization: Bearer <bencher.api.token>`. Where `<bencher.api.token>` is your Bencher API token.

The current solution to fix a branch named main would be to:

  1. Create a slot branch with its start point set to main at the desired good hash.
bencher branch create --token $BENCHER_API_TOKEN --name slot --start-point-branch main --start-point-hash bd84cf4de741432e851e1b266225d418118214e4 my-project
  1. Run an empty report using the slot branch. The important thing is that it increments the slot branch version. You don't have to explicitly include the branch hash here, it just has to match in the next step.
bencher run --token $BENCHER_API_TOKEN --project my-project --branch slot --hash 7effc0be8429ddef3d1a7ad780e4043f0b21b019 --adapter json "bencher mock --count 0"
  1. Now clone the slot start point back to main using that latest hash.
bencher branch update --token $BENCHER_API_TOKEN --start-point-branch temp --start-point-hash 7effc0be8429ddef3d1a7ad780e4043f0b21b019 my-project main
  1. Archive the slot branch.
bencher archive --token $BENCHER_API_TOKEN --project my-project --branch slot 
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

No branches or pull requests

1 participant