Skip to content

[jb-remote] hook gp cli #8025

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

Merged
merged 3 commits into from
Feb 9, 2022
Merged

[jb-remote] hook gp cli #8025

merged 3 commits into from
Feb 9, 2022

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Feb 4, 2022

Description

This PR enables support of gp CLI in JB products, namely credential helper, open and preview commands.
Caveat: It breaks gp cli in VS Code running alongside of JB products. We will have a look into separately: https://gitpod.slack.com/archives/C01KGM9BH54/p1644223793552719

This PR also include project specific IntelliIJ configs to enable dog fooding.

Related Issue(s)

Fixes #7980, fixes #7848

How to test

  • Start a workspace with IntelliJ: https://ak-jb-remote-git.staging.gitpod-dev.com/#referrer:jetbrains-gateway/https://github.com/gitpod-io/spring-petclinic
  • Try git push from cli and UI, you should see a notification about missing scopes in both cases. Clicking on the link should take you in access control page.
    • Sometimes UI is buggy and git integration is stuck, try to reopen then. It is not related to changes in this PR.
  • Grand missing scopes in the access control page and check that you can now trigger push from cli and UI without issues.
  • gp open pom.xml should open pom.xml file from terminal
  • gp open pom.xml --wait should open pom.xml file from terminal and block it till file is not closed
  • gp preview $(gp url 8080) should open the browser page

Design Review

You can find pair review with @felladrin here.

gp-idea drawio

Release Notes

NONE

Documentation

@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #8025 (34d131c) into main (913d963) will decrease coverage by 1.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8025      +/-   ##
==========================================
- Coverage   11.98%   10.82%   -1.16%     
==========================================
  Files          20       18       -2     
  Lines        1193     1025     -168     
==========================================
- Hits          143      111      -32     
+ Misses       1046      912     -134     
+ Partials        4        2       -2     
Flag Coverage Δ
components-gitpod-cli-app 10.82% <100.00%> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/gitpod-cli/cmd/credential-helper.go 5.49% <100.00%> (ø)
components/local-app/pkg/auth/auth.go
components/local-app/pkg/auth/pkce.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 913d963...34d131c. Read the comment docs.

@roboquat
Copy link
Contributor

roboquat commented Feb 5, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from akosyakov after the PR has been reviewed.

Associated issue: #7980

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@akosyakov akosyakov force-pushed the ak/jb-remote-git branch 7 times, most recently from 6e989fe to 3980803 Compare February 5, 2022 15:22
@akosyakov
Copy link
Member Author

akosyakov commented Feb 7, 2022

/werft run

👍 started the job as gitpod-build-ak-jb-remote-git.19

@akosyakov akosyakov force-pushed the ak/jb-remote-git branch 6 times, most recently from f65a919 to f81cf80 Compare February 8, 2022 12:38
@akosyakov akosyakov changed the title [jb-remote] hook git credential helper [jb-remote] hook gp cli Feb 8, 2022
@akosyakov akosyakov marked this pull request as ready for review February 8, 2022 14:08
@akosyakov akosyakov requested a review from a team February 8, 2022 14:08
@akosyakov
Copy link
Member Author

akosyakov commented Feb 9, 2022

@felladrin should be addressed, please double check before approving 🙏

otherwise do approve and let's deploy it tomorrow for testing with JB

@felladrin
Copy link
Contributor

felladrin commented Feb 9, 2022

Thanks! Rechecking now!

Copy link
Contributor

@felladrin felladrin left a comment

Choose a reason for hiding this comment

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

Code reviewed ✅

Tested with the same steps mentioned on the PR description ✅

Start a workspace with IntelliJ: https://ak-jb-remote-git.staging.gitpod-dev.com/#referrer:jetbrains-gateway/https://github.com/gitpod-io/spring-petclinic

Screenshot

Try git push from cli and UI, you should see a notification about missing scopes in both cases. Clicking on the link should take you in access control page.

Trying to push via CLI:

Screenshot

Screenshot

Trying to push via UI:

Screenshot

Screenshot

Screenshot

Screenshot

Grant missing scopes in the access control page and check that you can now trigger push from cli and UI without issues.

Access control page before setting permissions:

Screenshot

Access control page after setting permissions:

Screenshot

After setting permissions, git push works as expected:

Screenshot

Screenshot

gp open pom.xml should open pom.xml file from terminal

Screenshot

gp open pom.xml --wait should open pom.xml file from terminal and block it till file is not closed

Screenshot

Screenshot

gp preview $(gp url 8080) should open the browser page

Screenshot

Screenshot

@roboquat roboquat merged commit 5b57c9c into main Feb 9, 2022
@roboquat roboquat deleted the ak/jb-remote-git branch February 9, 2022 11:59
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production release-note-none size/XXL team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[jetbrains] fix git integration Some gp-cli commands do not integration/work with JetBrains IDE
3 participants