Skip to content

Import Java SDK as Experimental - #5504

Merged
gerhard merged 37 commits into
dagger:mainfrom
gerhard:import-sdk-java
Sep 18, 2023
Merged

gerhard merged 37 commits into
dagger:mainfrom
gerhard:import-sdk-java

Conversation

@gerhard

@gerhard gerhard commented Jul 24, 2023 •

Copy link
Copy Markdown
Contributor

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

@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

jcsirot commented Jul 24, 2023

Copy link
Copy Markdown
Contributor

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

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

@gerhard

gerhard commented Jul 25, 2023

Copy link
Copy Markdown
Contributor Author

OK! I just added that.

jcsirot added 13 commits July 25, 2023 21:38
…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]>
…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]>
- Container.fs -> Container.rootfs
- Container.exec -> Container.withExec

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

wingyplus commented Aug 18, 2023 •

Copy link
Copy Markdown
Contributor

@jcsirot Hi, I'm the Elixir SDK maintainer. Just see that Elixir pipeline jobs failed on this PR. This failure has already been solved on the main branch. Rebasing it should solve.

If you still facing an issue. Feel free to ping me. I can help to take a look to make sure you can get merged when it's ready.

@jcsirot

jcsirot commented Aug 18, 2023

Copy link
Copy Markdown
Contributor

@wingyplus Thank you. I'm going to rebase on the main branch and monitor the pipelines

@jcsirot

jcsirot commented Aug 21, 2023

Copy link
Copy Markdown
Contributor

@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

talios commented Aug 21, 2023

Copy link
Copy Markdown

@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

wingyplus commented Aug 21, 2023 •

Copy link
Copy Markdown
Contributor

@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

github-actions Bot commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

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

gerhard commented Sep 8, 2023

Copy link
Copy Markdown
Contributor Author

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

gerhard commented Sep 8, 2023

Copy link
Copy Markdown
Contributor Author

@gerhard

gerhard commented Sep 8, 2023

Copy link
Copy Markdown
Contributor Author

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

gerhard commented Sep 8, 2023 •

Copy link
Copy Markdown
Contributor Author

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
Gerhard Lazu added 3 commits September 8, 2023 19:54
@gerhard

gerhard commented Sep 8, 2023 •

Copy link
Copy Markdown
Contributor Author

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

gerhard commented Sep 8, 2023 •

Copy link
Copy Markdown
Contributor Author

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

How do we move ahead with publishing @jcsirot?


FTR:
image

@gerhard

gerhard commented Sep 11, 2023

Copy link
Copy Markdown
Contributor Author

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

@jcsirot

jcsirot commented Sep 12, 2023

Copy link
Copy Markdown
Contributor

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

@gerhard

gerhard commented Sep 12, 2023

Copy link
Copy Markdown
Contributor Author

Looking forward to it!

@gerhard

gerhard commented Sep 15, 2023 •

Copy link
Copy Markdown
Contributor Author

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

jcsirot commented Sep 15, 2023

Copy link
Copy Markdown
Contributor

@gerhard everything LGTM

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

@gerhard

gerhard commented Sep 15, 2023

Copy link
Copy Markdown
Contributor Author

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]>

@jcsirot jcsirot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gerhard

gerhard commented Sep 18, 2023

Copy link
Copy Markdown
Contributor Author

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