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(git): add debug #9683

Merged
merged 2 commits into from Apr 25, 2021
Merged

fix(git): add debug #9683

merged 2 commits into from Apr 25, 2021

Conversation

viceice
Copy link
Member

@viceice viceice commented Apr 22, 2021

Changes:

Log some debug from isBranchStale to find a stale branch bug

Context:

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or
  • No new tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

return !branches.all.map(localName).includes(branchName);
const isStale = !branches.all.map(localName).includes(branchName);
logger.debug(
{ isStale, branches, currentBranch, currentBranchSha },
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will log the full non-stale branch list once per-branch which calls isStale, right?

i.e. if there are 20 branches and 10 are non-stale then we'd get the same list of 10 branches logged 20 times during a run?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, but sometimes there must be something wrong. i don't now yet what, so i can reduce to only log branches.all but the branches.branches value can be interesting too, when the issue occure. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe currentbranchSha is wrong because of a silent git error happened on an other branch before?

Copy link
Contributor

@JamieMagee JamieMagee left a comment

Choose a reason for hiding this comment

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

More logging never hurt 😉

@rarkins
Copy link
Collaborator

rarkins commented Apr 24, 2021

We might want to drop the branches logging soon if it becomes too verbose

@JamieMagee
Copy link
Contributor

It's all in debug though, so barely anyone will see it.

@rarkins rarkins merged commit 00cb277 into main Apr 25, 2021
@rarkins rarkins deleted the fix/git-debug branch April 25, 2021 19:26
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 25.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants