Skip to content

Update jgit from 5.7.0 to 6.7.0. - #6544

Merged
matthiasblaesing merged 5 commits into
apache:masterfrom
matthiasblaesing:osgi-jgit
Oct 13, 2023
Merged

matthiasblaesing merged 5 commits into
apache:masterfrom
matthiasblaesing:osgi-jgit

Conversation

@matthiasblaesing

Copy link
Copy Markdown
Contributor
  • JGit 6.x requires JDK 11+
  • JGit split the main jar into multiple artifacts, this PR adds
    • org.eclipse.jgit
    • org.eclipse.jgit.lfs
    • org.eclipse.jgit.gpg.bc
    • org.eclipse.jgit.ssh.jsch
  • only minor API adjustments were needed even though JGit had 14 releases in the meantime (changes)

Closes: #6500
Fixes: #4197
Unblocks: #6528

mbien and others added 3 commits October 2, 2023 02:29
Fixes issues when modules with JDK 11 requirement are loaded.
 - JGit 6.x requires JDK 11+
 - JGit split the main jar into multiple artifacts, this adds
   - org.eclipse.jgit
   - org.eclipse.jgit.lfs
   - org.eclipse.jgit.gpg.bc
   - org.eclipse.jgit.ssh.jsch
 - only minor code adjustments needed
@matthiasblaesing matthiasblaesing added Upgrade Library Library (Dependency) Upgrade git [ci] enable versioning job ci:all-tests [ci] enable all tests ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Oct 7, 2023
@matthiasblaesing matthiasblaesing added this to the NB20 milestone Oct 7, 2023
@matthiasblaesing

Copy link
Copy Markdown
Contributor Author

There were questions raised in the base PR (#6500) regarding NetBeans OSGI support (I think @mbien and @neilcsmith-net were involved):

  • Can the NetBinox OSGI integration handle Multi-Release JARs?: I tested this with a manually built OSGI jar, where I created a bundle activator, that reported a number. The reported value matched the implementation located in META-INF/versions/17.
  • Is the OSGI Fragment-Host header support?: JGit relies on the Fragment-Host header for JSch and OpenPGP support. Both were manually verified.

The questions about OSGI integration support for NetBeans are valid though as two limitations were found and had to be fixed:

  • The parsing of the Fragment-Host header did not account for bundle specifications with version constraints. To fix this the code already used when parsing the Export-Package was also applied for the Fragment-Host.
  • JGit declares a dependency on the runtime java version via the Bundle-RequiredExecutionEnvironment header. This is checked against the list of values present in org.osgi.framework.executionenvironment by the OSGI runtime. This value was basicly fixed on the one matching JDK 8 in Equinox. To support later JDKs the value of org.osgi.framework.executionenvironment is now calculated by the NetBinox infrastructure before the OSGI framework is initialized.

@jtulach I think you are best qualified to review the OSGI/NetBinox changes. Could you please have a look at d32a76e and 7ff7e87?

With regard to #4439 we need to implement an CredentialsProvider, that dispatches display/querying of data to Swing and integrates with the NetBeans KeyRing. The GitCommand subclasses need to be modified to set that provider. I injected a test implementation that returned a hard coded passphrase and that enabled me to create a signed commit.

@mbien mbien left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

changes look good to me

We could add a short comment in future updates to mark osgi lib wrappers. Since unless you look into the jar, there is nothing what explains the missing manifest attributes which would be in regular modules. Since manifests don't allow comments (I think), maybe somewhere in the project.properties or build.xml?

@matthiasblaesing

Copy link
Copy Markdown
Contributor Author

I plan to merge this at the beginning of the weekend.

@mbien

mbien commented Oct 12, 2023

Copy link
Copy Markdown
Member

I plan to merge this at the beginning of the weekend.

great! allows to rebase and review #6528 before freeze.

@Vitexus

Vitexus commented Oct 13, 2023

Copy link
Copy Markdown
Contributor

obrazek

Good job guys! I'm looking forward the next NetBeans release :)

@matthiasblaesing

Copy link
Copy Markdown
Contributor Author

Ok, lets get this in and give the things waiting on this a chance to go in to.

@Vitexus just to not get the hopes up. This PR is not yet about the implementation of the CredentialsProvider, just getting an updates jgit.

@matthiasblaesing
matthiasblaesing merged commit 9805027 into apache:master Oct 13, 2023
@matthiasblaesing
matthiasblaesing deleted the osgi-jgit branch April 9, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:all-tests [ci] enable all tests ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) DO NOT squash git [ci] enable versioning job Upgrade Library Library (Dependency) Upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileAlreadyExistsException (JGit issue - upgrade req.)

3 participants