Skip to content

Conversation

gerhard
Copy link
Contributor

@gerhard gerhard commented Jul 24, 2023

This imports https://github.com/jcsirot/dagger-java-sdk under sdk/java as an experimental SDK.

@gerhard action items (part of this PR)

git remote add dagger-sdk-java https://github.com/jcsirot/dagger-java-sdk
git fetch dagger-sdk-java --no-tags
git checkout -b sdk/java dagger-sdk-java/main
mkdir -p sdk/java
git ls-tree -z --name-only HEAD | xargs -0 -I {} git mv {} sdk/java/
git commit --gpg-sign --signoff

git checkout main
git pull
git checkout -b import-sdk-java

git merge --gpg-sign --signoff --allow-unrelated-histories sdk/java

git push -u fork
  • Give @jcsirot write permissions to dagger repository
  • Add @jcsirot to CODEOWNERS (@dagger/sdk-dotnet group)
  • Mention in SDK's README that it is currently experimental
  • Review internal/mage/sdk/java.go
  • Complete https://central.sonatype.org/publish/ for dagger.io
  • Ensure we are using Apache 2.0 license, same as all other SDKs
  • Merge PR 🚀

@jcsirot action items (part of this PR)

Follow-ups (outside / after this PR)

Did I miss anything @jcsirot?


Fixes DEV-2320 cc @shykes @helderco @mircubed @d3rp3tt3

jcsirot and others added 15 commits May 29, 2023 01:56
Signed-off-by: Jean-Christophe Sirot <[email protected]>
Initial version of the SDK
---------

Signed-off-by: Jean-Christophe Sirot <[email protected]>
* build: clean up build

update pom.xml dependency management
remove unused dependencies
remove unused import

* build: Add maven exec plugin to run the code samples from the CLI
Set the log level to debug in integration tests
fix(connection): refactoring of the engine connection package

Move CLIRunner and ConnectParams to a dedicated class file
Replace JSON-B by JSON-P to deserialize the connection parameters
Move the Dagger CLI process execution to the CLI runner (Single-responsibility principle)
Fix process hanging when connection to the engine failed
Improve code style
Add some tests for Connection class

---------

Signed-off-by: Jean-Christophe Sirot <[email protected]>
macos is limited to PR builds
So far windows VM does not support Linux containers

Signed-off-by: Jean-Christophe Sirot <[email protected]>
)

package jar with dependencies and upload artifact in github
upload artifact only on push to main
update README.md
---------

Signed-off-by: Jean-Christophe Sirot <[email protected]>
So that this can be imported into dagger/dagger repository

Signed-off-by: Gerhard Lazu <[email protected]>
But keep as is, same as we did for other experimental SDKs.

Signed-off-by: Gerhard Lazu <[email protected]>
@jcsirot
Copy link
Contributor

jcsirot commented Jul 24, 2023

@gerhard among the actions which are part of this PR I would also add:

  • rename package names org.chelonix.dagger.* to io.dagger.*

@gerhard
Copy link
Contributor Author

gerhard commented Jul 25, 2023

OK! I just added that.

jcsirot added 2 commits July 28, 2023 14:26
…es and use it when schema is not available. Inject the CLI version in the code at build time

Signed-off-by: Jean-Christophe Sirot <[email protected]>
jcsirot added 6 commits July 28, 2023 17:22
…le dedicated to deployment

Signed-off-by: Jean-Christophe Sirot <[email protected]>
…ome log messages

Signed-off-by: Jean-Christophe Sirot <[email protected]>
Signed-off-by: Jean-Christophe Sirot <[email protected]>
Signed-off-by: Jean-Christophe Sirot <[email protected]>
Signed-off-by: Jean-Christophe Sirot <[email protected]>
- add initial build worflow in internal/mage/sdk/java.go
- add test & lint actions in github action worflow

Signed-off-by: Jean-Christophe Sirot <[email protected]>
@jcsirot jcsirot force-pushed the import-sdk-java branch 2 times, most recently from c1b6bdf to 1a32215 Compare July 28, 2023 16:13
@jcsirot
Copy link
Contributor

jcsirot commented Aug 21, 2023

@wingyplus I tried to rebase on main but the process encounters a lot of conflicts. I think this is because a lot of files were moved from the root of the repo to sdk/java when @gerhard imported the code from the original SDK repo. Maybe for the moment I could cherry-pick the commits that fixes the issue with the Rust SDK?

@gerhard I also tried to squash the commits in the PR but I also have the same issues with a lot of conflicts, for instance on README.md or the files in .github/ directory. Maybe you acquired some experience with the SDK you previously imported?

@talios
Copy link

talios commented Aug 21, 2023

@jcsirot If the branch you're rebasing has just moved wholesale into the sub dir - you could possibly rewrite your local checkout with filter-branch with the --index-filter (https://git-scm.com/docs/git-filter-branch) - so you're existing version is now under that path, then return to normal rebasing?

It almost feels similar to what I did when migrating our old subversion repos which I wrote about ages ago on https://www.theoryinpractice.net/post/1350252794/repository-migration-from-subversion-to-git using that and a bit of awk.

@wingyplus
Copy link
Contributor

wingyplus commented Aug 21, 2023

@wingyplus I tried to rebase on main but the process encounters a lot of conflicts. I think this is because a lot of files were moved from the root of the repo to sdk/java when @gerhard imported the code from the original SDK repo. Maybe for the moment I could cherry-pick the commits that fixes the issue with the Rust SDK?

@gerhard I also tried to squash the commits in the PR but I also have the same issues with a lot of conflicts, for instance on README.md or the files in .github/ directory. Maybe you acquired some experience with the SDK you previously imported?

I remember that I face a similar issue during move Elixir SDK into Dagger. But at that time, I manually resolved it one-by-one. 😂

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@gerhard
Copy link
Contributor Author

gerhard commented Sep 8, 2023

I am picking this one up now @jcsirot.

The merge with main addressed all conflicts.

I am going over the remaining action items now.

@gerhard
Copy link
Contributor Author

gerhard commented Sep 8, 2023

I submitted a JIRA ticket for https://central.sonatype.org/publish/, waiting for https://issues.sonatype.org/browse/OSSRH-94866 to be resolved.

@gerhard
Copy link
Contributor Author

gerhard commented Sep 8, 2023

Also finished reviewing internal/mage/sdk/java.go, all these work as expected & pass locally:

  • dagger run ./hack/make sdk:java:lint
  • dagger run ./hack/make sdk:java:test
  • dagger run ./hack/make sdk:java:generate

@gerhard
Copy link
Contributor Author

gerhard commented Sep 8, 2023

The last thing to check are the GHA workflows.

As I do that, do you want to review the PR @jcsirot?

@gerhard gerhard requested a review from jcsirot September 8, 2023 10:49
Leverage the re-usable _hack_make workflow.

Signed-off-by: Gerhard Lazu <[email protected]>
@gerhard
Copy link
Contributor Author

gerhard commented Sep 8, 2023

All checks are now green, including: https://github.com/dagger/dagger/actions/runs/6125459830?pr=5504
image

There are 2 actions items for you @jcsirot before this can be merged:

  1. Use Apache 2.0 license in sdk/java/LICENSE so that we are consistent (Engine + CLI & all our SDKs use it), e.g. https://github.com/dagger/dagger/blob/main/sdk/elixir/LICENSE
  2. Approve this PR

This one has been a long time coming, it will be so amazing to merge this as soon as the above are done @jcsirot 💪

@gerhard
Copy link
Contributor Author

gerhard commented Sep 8, 2023

https://issues.sonatype.org/browse/OSSRH-94866 has now been solved too.

How do we move ahead with publishing @jcsirot?


FTR:
image

@gerhard
Copy link
Contributor Author

gerhard commented Sep 11, 2023

Anything else that I can do @jcsirot to help move this one along?

@jcsirot
Copy link
Contributor

jcsirot commented Sep 12, 2023

@gerhard I'm planning to review everything tonight or tomorrow

@gerhard
Copy link
Contributor Author

gerhard commented Sep 12, 2023

Looking forward to it!

@gerhard
Copy link
Contributor Author

gerhard commented Sep 15, 2023

If you agree with my last commit @jcsirot:

  • edit the commit message & remove this paragraph
  • append your Signed-off-by
  • commit & force push

Once that is done, the only thing left for you is to approve this PR. I can handle the merge, no worries!

Today is a great day to get this finally done @jcsirot 💪

@jcsirot
Copy link
Contributor

jcsirot commented Sep 15, 2023

@gerhard everything LGTM

Should I squash all commits or leave the history as is?

@gerhard
Copy link
Contributor Author

gerhard commented Sep 15, 2023

Hey @jcsirot!

First step for you is to make the change that I mentioned in my previous comment.

Second step is to approve the PR via:
image

As you can see above, I cannot approve my own PR.

Engine & CLI use the same Apache 2.0 license.

Signed-off-by: Jean-Christophe Sirot <[email protected]>
Copy link
Contributor

@jcsirot jcsirot left a comment

Choose a reason for hiding this comment

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

LGTM

@gerhard
Copy link
Contributor Author

gerhard commented Sep 18, 2023

Thank you @jcsirot!

Will get this merged as soon as v0.8.6 is out - mid-release right now.

@gerhard gerhard merged commit 989165c into dagger:main Sep 18, 2023
@gerhard gerhard deleted the import-sdk-java branch September 18, 2023 18:58
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.

5 participants