Skip to content

Conversation

@msagi
Copy link
Contributor

@msagi msagi commented Mar 16, 2024

Fixes #481 .

Using the CLI

Prerequisites

  • Proxy and REST API are running (default behaviour)
  • The Git Proxy URL is configured via the GIT_PROXY_UI_URL environment variable (defaults to http://localhost:8080). Note: this documentation assumes that Git Proxy UI is running on http://git-proxy.com:8080.
  • Intercepting a push instructions have been followed and you've reached Push via Git Proxy

Instructions

1. Find the tracking ID

Following on from Push via Git Proxy, you'll receive a unique URL:

http://localhost:8080/requests/0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f

The ID for your push corresponds to the last part of the URL:

0000000000000000000000000000000000000000__79b4d8953cbc324bcc1eb53d6412ff89666c241f

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': OK

3. Approve the push with ID

Use the commit ID to 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': OK

4. Re-push your code

Execute git push to send your approved code through Git Proxy to the upstream repository:

$ git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 10 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 470 bytes | 470.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.

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

@netlify
Copy link

netlify bot commented Mar 16, 2024

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit d037f9e
🔍 Latest deploy log https://app.netlify.com/sites/endearing-brigadeiros-63f9d0/deploys/6615a3f9c35c26000857afb7

@socket-security
Copy link

socket-security bot commented Mar 16, 2024

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

@codecov
Copy link

codecov bot commented Mar 16, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 64.23%. Comparing base (f3fd0ee) to head (d037f9e).

Files Patch % Lines
src/service/routes/push.js 75.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@JamieSlome JamieSlome requested a review from coopernetes March 18, 2024 17:49
@JamieSlome JamieSlome added the enhancement New feature or request label Mar 18, 2024
@JamieSlome JamieSlome self-requested a review March 18, 2024 17:51
@JamieSlome JamieSlome assigned JamieSlome and msagi and unassigned JamieSlome Mar 18, 2024
@JamieSlome
Copy link
Member

@msagi - are the CLI commands runnable via npx as well? 👍

@msagi msagi requested a review from JamieSlome March 24, 2024 00:19
@msagi
Copy link
Contributor Author

msagi commented Mar 24, 2024

Refactored the CLI tool to be a package, incorporated @JamieSlome 's feedback from his comments.

Copy link
Contributor

@coopernetes coopernetes left a 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.

msagi and others added 7 commits March 26, 2024 09:37
@JamieSlome
Copy link
Member

JamieSlome commented Apr 8, 2024

@msagi - for your and reference of others reviewing this pull request, the following issue has been opened to address the precedent of failing status checks:

#519

Moreover, #520 has been opened to address the issue itself.

Copy link
Member

@JamieSlome JamieSlome left a comment

Choose a reason for hiding this comment

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

LGTM! 🍰

@JamieSlome
Copy link
Member

@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? 👍

Copy link
Contributor

@coopernetes coopernetes left a 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 🚀

@coopernetes coopernetes merged commit 56ef2ab into finos:main Apr 11, 2024
Psingle20 pushed a commit to Psingle20/git-proxy that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command line interface for administrators

4 participants