Skip to content

feat(version): add --push-tags-one-by-one, fixes #701#871

Merged
ghiscoding merged 9 commits intomainfrom
feat/version-push-tag-one-at-time
Jun 3, 2024
Merged

feat(version): add --push-tags-one-by-one, fixes #701#871
ghiscoding merged 9 commits intomainfrom
feat/version-push-tag-one-at-time

Conversation

@ghiscoding
Copy link
Copy Markdown
Member

Description

Push Git tags one by one

Motivation and Context

How Has This Been Tested?

Types of changes

  • Chore (change that has absolutely no effect on users)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link
Copy Markdown

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.77%. Comparing base (0cebdb6) to head (29fca51).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #871      +/-   ##
==========================================
+ Coverage   97.76%   97.77%   +0.01%     
==========================================
  Files         155      155              
  Lines        7876     7906      +30     
  Branches     1921     1932      +11     
==========================================
+ Hits         7699     7729      +30     
  Misses        176      176              
  Partials        1        1              

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

@ghiscoding
Copy link
Copy Markdown
Member Author

ghiscoding commented May 31, 2024

@StarpTech I'm not at all sure if that would fix the issue you brought in issue #701, so I'd like to have your opinion. I tried in dry-run mode by switching Lerna-Lite from fixed version to independent mode. I also did not try the Git commands either, so I have no idea if it would work or fail. I rarely type Git commands in the shell (I'm typically fine with VSCode so...)

So do you think that would work or is it going in the wrong direction? Because if that doesn't work then I have no idea on how else to address the problem. You can see below each tag are created 1 by 1 (that is nothing new, it was already like that) but then the next section "Pushing tags..." is where it's different, it's try to push the Git tags one at a time (if the Git command works, I'm not sure).

Here's 1 Git command (which again I haven't tried, so it might fail)

git push --no-verify --atomic origin @lerna-lite/cli@4.0.0 main

Actually 1 thing that I'm not sure is that the Git push is async and in Lerna it's awaiting the current one with await this.gitPushToRemote();. So I probably need to await each Git push individually with the new option.

EDIT

I modified the code to enqueue all Git push promises and also added p-limit with a concurrency of 1 to push to remote. I think the code will now better represent the 1 at a 1 execution. @StarpTech I still wish to get feedback from your side if you think this could potentially fix your problem. Also note again that I cannot run this on a live example at the moment because Lerna-Lite doesn't use independent mode, unless I create a full monorepo demo which would take more time.

image

@ghiscoding ghiscoding marked this pull request as draft May 31, 2024 04:27
@ghiscoding
Copy link
Copy Markdown
Member Author

Created a basic monorepo lernalite-basic-boiler for testing this option, it looks fine and pushed each git tags 1 by 1 as shown below in the verbose logs. So it looks fine to proceed

image

@ghiscoding ghiscoding marked this pull request as ready for review June 1, 2024 03:19
@ghiscoding
Copy link
Copy Markdown
Member Author

no feedback provided, but let's go ahead with it in a new release. @StarpTech if you have a chance to try it in the future and confirm that it works, that would be great. I think the PR will fix the GitHub limit. Cheers

@ghiscoding ghiscoding merged commit 88ad61b into main Jun 3, 2024
@ghiscoding ghiscoding deleted the feat/version-push-tag-one-at-time branch June 3, 2024 16:10
@StarpTech
Copy link
Copy Markdown
Contributor

Hi, in your repo, were you able to reproduce the issue?

@ghiscoding
Copy link
Copy Markdown
Member Author

ghiscoding commented Jun 5, 2024

@StarpTech no since the repo is quite basic and it only has 2 packages so I won't hit the limit, however I tested the git push 1 by 1 and it seems to be working as expected. Since it is really being sent 1 by 1 to the git remote, I'm assuming this will fix the issue (however please note that it will of course take longer to send all package tags since they are run 1 at a time and in series)

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.

Allow to push tags one by one to overcome GitHub limit

2 participants