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

fix: determine if the branch exists first #1173

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

dcshzj
Copy link
Contributor

@dcshzj dcshzj commented Feb 26, 2024

Problem

We get a lot of such errors when users access their site dashboard when retrieving the last saved and last published information:

Error when getting latest commit of "master" branch: Error: fatal: ambiguous argument 'master': unknown revision or path not in the working tree.

This happens because we try to get the Git log for the master branch first, before attempting on origin/master. The first one will fail as the master branch does not exist on EFS, but origin/master does.

Solution

Breaking Changes

  • Yes - this PR contains breaking changes
  • No - this PR is backwards compatible with ALL of the following feature flags in this doc

Bug Fixes:

  • Determine if the branch exists first before continuing to get the Git log, so that we avoid encountering the error unnecessarily.

Tests

  • Navigate to any site dashboard.
  • Verify from the logs that there are no errors shown that matches the error log above.
  • Verify that you can see Unable to ascertain that "master" branch... log line as an info log.

Deploy Notes

None

@dcshzj dcshzj requested a review from a team February 26, 2024 09:27
jacobkwan
jacobkwan previously approved these changes Feb 26, 2024
@dcshzj dcshzj requested review from jacobkwan and a team February 26, 2024 11:25
@dcshzj dcshzj requested review from jacobkwan and a team February 26, 2024 11:49
@dcshzj dcshzj merged commit a454861 into develop Feb 27, 2024
12 checks passed
@mergify mergify bot deleted the fix/determine-branch-exists-first branch February 27, 2024 01:48
@kishore03109 kishore03109 mentioned this pull request Feb 28, 2024
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