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

return error instead of panicking upon branch hijacking #168

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

krancour
Copy link
Member

@krancour krancour commented Sep 22, 2023

Fixes #166

This will prevent the nil pointer dereference that currently occurs when Bookkeeper is asked to write to an existing branch that isn't already Bookkeeper-managed.

It will return an error instead, which seems like the most sensible thing to do, because this was probably a mistake on the user's part.

If you do want Bookkeeper to take over an existing branch, you can either delete the target branch or manually touch .bookkeeper/metadata.yaml on the target branch.

cc @jessesuen @christianh814 this tripped up both of you (and me too) at some point in recent weeks.

@netlify
Copy link

netlify bot commented Sep 22, 2023

Deploy Preview for docs-bookkeeper-akuity-io canceled.

Name Link
🔨 Latest commit 733bae1
🔍 Latest deploy log https://app.netlify.com/sites/docs-bookkeeper-akuity-io/deploys/6511ac4d6703f70007287acd

@krancour krancour changed the title return error if it looks like a branch hijacking return error instead of panicing upon branch hijacking Sep 22, 2023
@krancour krancour changed the title return error instead of panicing upon branch hijacking return error instead of panicking upon branch hijacking Sep 22, 2023
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.23% ⚠️

Comparison is base (812f794) 37.48% compared to head (733bae1) 37.26%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
- Coverage   37.48%   37.26%   -0.23%     
==========================================
  Files          19       19              
  Lines        1139     1146       +7     
==========================================
  Hits          427      427              
- Misses        695      702       +7     
  Partials       17       17              
Files Changed Coverage Δ
service.go 6.76% <0.00%> (-0.14%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@gdsoumya gdsoumya left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@christianh814 christianh814 left a comment

Choose a reason for hiding this comment

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

LGTM!

@krancour krancour merged commit 03f22b1 into akuity:main Sep 25, 2023
8 of 10 checks passed
@krancour krancour deleted the krancour/no-hijacking branch September 25, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should refuse to write to existing, non-Bookkeeper-managed target branch
3 participants