-
Notifications
You must be signed in to change notification settings - Fork 149
Add CLI tool for easy push approval for administrators #482
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
Conversation
✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.
|
|
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #482 +/- ##
==========================================
+ Coverage 57.35% 64.23% +6.87%
==========================================
Files 39 40 +1
Lines 1060 1191 +131
==========================================
+ Hits 608 765 +157
+ Misses 452 426 -26 ☔ View full report in Codecov by Sentry. |
|
@msagi - are the CLI commands runnable via |
|
Refactored the CLI tool to be a package, incorporated @JamieSlome 's feedback from his comments. |
coopernetes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, solid on implementation. A few odds & ends to address.
This makes the push command work with any default branch name. Currently, if blindly copied & pasted and the repository has a different default branch, people will receive the error 'error: src refspec {name} does not match any'.
JamieSlome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🍰
|
@coopernetes - still got an outstanding "requested changes" status on this pull request from you. Are you able to resolve and we can merge the pull request? 👍 |
coopernetes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, merge it, ship it 🚀
Fixes #481 .
Using the CLI
Prerequisites
http://localhost:8080). Note: this documentation assumes that Git Proxy UI is running onhttp://git-proxy.com:8080.Instructions
1. Find the tracking
IDFollowing on from Push via Git Proxy, you'll receive a unique URL:
The
IDfor your push corresponds to the last part of the URL:2. Authenticate with the CLI
Use the default & auto-generated Git Proxy username & password credentials to authenticate and obtain a cookie. The cookie value is saved to a file (
git-proxy-cookie):$ npm run-script cli -- login --username admin --password admin Git-Proxy URL: http://git-proxy.com:8080 Auth 'admin': OK3. Approve the push with
IDUse the commit
IDto approve your push with the CLI:$ npm run-script cli -- approve --commitId 0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f Git-Proxy URL: http://git-proxy.com:8080 Approve: ID: '0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f': OK4. Re-push your code
Execute
git pushto send your approved code through Git Proxy to the upstream repository:5. Log out
Clean up your connect cookie via logging out:
$ npm run-script cli -- logout Git-Proxy URL: http://git-proxy.com:8080 Logout: OK