Skip to content
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

[gitpod-protocol] Add Java client implementation #5795

Merged
merged 1 commit into from Oct 11, 2021

Conversation

corneliusludmann
Copy link
Contributor

@corneliusludmann corneliusludmann commented Sep 21, 2021

Description

This PR adds a Java API client implementation for the gitpod-protocol. This will be consumed by the JetBrains plugins that sends heartbeats for the Gitpod workspace.

Related Issue(s)

Solves partly #5603

How to test

For a quick test, there is a TestClient class. Change the variables uri, token and origin and run:

$ cd components/gitpod-protocol/java
$ ./gradlew run

Release Notes

NONE

Meta

/werft no-preview
/uncc

@corneliusludmann
Copy link
Contributor Author

@akosyakov This is a POC-like Java implementation of the gitpod-server protocol. I would suggest not to implement every function but only the functions needed for the JetBrains implementation.

Thus, I would suggest to work on #5642 in parallel and keep this PR open until we implemented the client part on the JetBrains plugin.

@akosyakov
Copy link
Member

akosyakov commented Sep 22, 2021

@akosyakov This is a POC-like Java implementation of the gitpod-server protocol. I would suggest not to implement every function but only the functions needed for the JetBrains implementation.

👍 Yes, it was the plan

@stale
Copy link

stale bot commented Oct 2, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Oct 2, 2021
@corneliusludmann corneliusludmann removed the meta: stale This issue/PR is stale and will be closed soon label Oct 2, 2021
@corneliusludmann corneliusludmann force-pushed the clu/gitpod-protocol-java branch 3 times, most recently from 6a4a144 to 50d9401 Compare October 5, 2021 15:16
@corneliusludmann
Copy link
Contributor Author

corneliusludmann commented Oct 6, 2021

I've updated this PR with

  • a BUILD.yaml file that builds the jar file
  • license headers in the JAVA files (which has been added by the addlicense tool after adding the BUILD.yaml file automatically)

see also: #5687 (comment)

@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.


@Override
public int hashCode() {
final Integer prime = 31;
Copy link
Member

Choose a reason for hiding this comment

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

off-topic: Wow, reading this code brings back memories... when IDE did not have a "auto-generate hashCode and equals method", yet. The forgotten art of writing those methods by hand was just... hilarious is maybe the best way to put it. 😄

@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yaml was changed and it might be harmful.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

/lgtm

@geropl Could you give an approve too? 🙏 It is more intermediate step that we can bring IntelliJ plugins.

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: b14f19f436d71a8d61b03300ce91c38eeed95f6c

@akosyakov
Copy link
Member

/assign @gtsiolis

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Approving per #5795 (review) and #5795 (comment) to unblock merging but holding in case this needs a closer look at the code. Feel free to remove do-not-merge/hold label and merge if this looks good to merge.

/hold

@corneliusludmann
Copy link
Contributor Author

Thanks George! Gero has given the go-ahead. 🙏 Removing hold now.

@roboquat roboquat merged commit 0d3202c into main Oct 11, 2021
@roboquat roboquat deleted the clu/gitpod-protocol-java branch October 11, 2021 12:58

// Set env vars GITHUB_GPR_USERNAME and GITHUB_GPR_TOKEN and run:
// ./gradlew publish
publishing {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we can remove this, as the ones depending on it will live in this monorepo.

If you agree, I will remove the same piece of code from supervisor-api/java in the context of adding the intellij-backend-plugin to the repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, definitely. Sounds good!

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akosyakov, atduarte, gtsiolis

Associated issue: #5603

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

The pull request process is described 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants