Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: implement tags push inverifyAuth dry-run operation and isolate branch status check#3447

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
babblebey wants to merge18 commits intomaster
base:master
Choose a base branch
Loading
fromrefactor/verify-auth

Conversation

@babblebey
Copy link
Member

@babblebeybabblebey commentedSep 16, 2024
edited
Loading

This PR refactors theverifyAuth function replacing the normal push dry-run (which could result in a branch outdated error/notice) with a tags dry-run push. It does this by separating the push permission check operation in theverifyAuth logic from theisBranchUpdated logic that lived in thesame execution block via atry-catch into standalone operations; this branch status check only occured when the push permission check fails.

Changes Made

  • ModifyverifyAuth logic to do a tags dry run instead of a branch dry-run push
  • SeparateverifyAuth to a standalone block to throw a"EGITNOPERMISSION" if no push permission is found
  • Improved theisBranchUpdated helper to ensure it checks for cases where local branch is either behind, ahead or diverged of head remote branch and return appropriate boolean response which in this case is...
    • false - when local branch is behind remote branch
    • true - when local branch is ahead of remote branch
    • false - when local branch and remote branch have commits that the other doesn't
  • Make the branch up to date check a standalone process in the release verification process returningfalse when branch is considered not up-to-date - with a message
    if(!(awaitisBranchUpToDate(options.repositoryUrl,context.branch.name,{ cwd, env}))){logger.log(`The local branch${context.branch.name} is behind the remote one, therefore a new version won't be published.`);returnfalse;}

BREAKING CHANGE

  • semantic-release now checks if your local branch is up-to-date with your remote repo branch regardless of your push permission verification result.

Related Issue

Fixes#3437

@travi
Copy link
Member

This PR refactors

smallish suggestion: "refactor" is a word that is often confused in the software community. used correctly, it should mean a change to the structure of the code that does not change the behavior of the code. in this case, the behavior is changed, so we should be careful not to use "refactor" in this case. i would consider this a feature instead

@babblebey
Copy link
MemberAuthor

smallish suggestion: "refactor" is a word that is often confused in the software community. used correctly, it should mean a change to the structure of the code that does not change the behavior of the code. in this case, the behavior is changed, so we should be careful not to use "refactor" in this case. i would consider this a feature instead

Very true... well noted! Thank you 😁

@babblebeybabblebey changed the titlerefactor: push tags in dry-run in verify lifecyclefeat: push tags in dry-run in verify lifecycleSep 27, 2024
@babblebeybabblebey marked this pull request as draftJuly 12, 2025 02:53
@babblebeybabblebey changed the titlefeat: push tags in dry-run in verify lifecyclefeat: implement tags push inverifyAuth dry-run operation and isolate branch status checkJul 12, 2025
@babblebeybabblebey marked this pull request as ready for reviewJuly 12, 2025 19:33
Comment on lines +95 to +100
if(!(awaitisBranchUpToDate(options.repositoryUrl,context.branch.name,{ cwd, env}))){
logger.log(
`The local branch${context.branch.name} is behind the remote one, therefore a new version won't be published.`
);
returnfalse;
}
Copy link
MemberAuthor

@babblebeybabblebeyJul 12, 2025
edited
Loading

Choose a reason for hiding this comment

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

Hi hi@travi,

This check used to be conditionally executed i.e. it only runs when thepush permission check in theverifyAuth logic fails or throws an error... This PR isolates the check bringing it into the verifications during the release process regardless of the push permission check result... What do you think??

  • Is this alright??
  • Can it be consider a breaking change?? If so - can we align with thebeta??
  • What you think about havingdiverged repo/branches considered as not up-to-date in the context of publishing releases?

Copy link
Member

Choose a reason for hiding this comment

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

thanks for bringing my attention back to this one

  • Can it be consider a breaking change?? If so - can we align with thebeta??

help me understand what would make this breaking. if the push permission check succeeds, the flow would continue to this point. if it fails, that check throws an error before reaching this point, correct? it seems like the actual behavior remains essentially the same regarding this detail, so that seems non-breaking to me. is this more than just a fix? if so, help me see what i'm overlooking

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

If you put that way, It really does behave similarly. But slightly difference is that if the push permission passes... We don't really care much whether the branch is up to date or not.

This change here insists on checking if the branch is up to date after the push permission passes.

Now, is that change break worthy??? 🤔

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@travitravitravi left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

git push --dry-run --no-verify fails "branch tip is behind its remote"

3 participants

@babblebey@travi

[8]ページ先頭

©2009-2025 Movatter.jp