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

Require Jenkins 2.479 or newer #1172

Merged
merged 40 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c14430c
Test JGit 7.0.0-m2 pre-release with Java 17 build
MarkEWaite Aug 7, 2024
7f33b16
Test JGit 7.0.0 with Jakarta EE 9 Jenkins core
MarkEWaite Aug 7, 2024
d9ef6d2
Merge branch 'master' into test-jgit-7.0.0
Aug 23, 2024
de63f62
Merge branch 'test-jgit-7.0.0' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Aug 23, 2024
42b7533
Use JGit 7.0.0.202408202050-m3 pre-release
MarkEWaite Aug 23, 2024
1272adc
Merge branch 'test-jgit-7.0.0' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Aug 23, 2024
1527459
Merge branch 'master' into test-jgit-7.0.0
MarkEWaite Aug 27, 2024
890c0b8
Merge branch 'test-jgit-7.0.0' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Aug 27, 2024
1fb75a3
Merge branch 'master' into test-jgit-7.0.0
MarkEWaite Sep 5, 2024
3398faa
Use JGit 7.0.0.202409031743-r
MarkEWaite Sep 5, 2024
8f47f3c
Adapt to removed API's in JGit 7.0.0
MarkEWaite Sep 5, 2024
0a30ea6
Merge branch 'test-jgit-7.0.0' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 5, 2024
15c3bdc
Use test harness 2265.x
Sep 6, 2024
480ce4b
Next Jenkins baseline will be a .1
Sep 6, 2024
c8d24d2
Merge branch 'test-jgit-7.0.0' into test-jgit-7.0.0-with-jakarta-ee-9
Sep 6, 2024
e81905e
Merge branch 'test-jgit-7.0.0-with-jakarta-ee-9' of github.com:MarkEW…
MarkEWaite Sep 6, 2024
1189a30
Use JGit 7.0.0 with Java 17
MarkEWaite Aug 7, 2024
8cbab98
Merge branch 'master' into test-jgit-7.0.0
MarkEWaite Sep 12, 2024
ef1a30d
Merge branch 'test-jgit-7.0.0' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 12, 2024
dfd8fe7
Use 6.1.0 as version
MarkEWaite Sep 12, 2024
9ab0ff9
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 12, 2024
086160a
Use Java 17 features in source code
MarkEWaite Sep 13, 2024
c938624
Merge branch 'use-java-17-source-code' into test-jgit-7.0.0-with-jaka…
MarkEWaite Sep 13, 2024
2654136
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 13, 2024
79858bb
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 13, 2024
8705589
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 18, 2024
da6c15f
Require Jenkins 2.477
MarkEWaite Sep 18, 2024
62ddbe0
Use test harness that drops EE 8
MarkEWaite Sep 18, 2024
c9596fd
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 20, 2024
6da4ecd
Use Jenkins test harness 2289.x
MarkEWaite Sep 20, 2024
51b1c07
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
Sep 23, 2024
500dafa
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Sep 28, 2024
077f7d6
Use test harness 2299.*
MarkEWaite Sep 28, 2024
a552071
Use parent pom 5.0
MarkEWaite Oct 3, 2024
4bcca7e
Security scan not ready for Java 17 and Jakarta EE 9
MarkEWaite Oct 3, 2024
9e221f6
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Oct 4, 2024
88a4d4b
Use parent pom 5.1
MarkEWaite Oct 7, 2024
7720f48
Revert "Security scan not ready for Java 17 and Jakarta EE 9"
MarkEWaite Oct 7, 2024
33d0163
Use StaplerRequest2 for EE 9
MarkEWaite Oct 9, 2024
a1b6883
Merge branch 'master' into test-jgit-7.0.0-with-jakarta-ee-9
MarkEWaite Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adapt to removed API's in JGit 7.0.0
  • Loading branch information
MarkEWaite committed Sep 5, 2024
commit 8f47f3cd21a5ee7e7176836f18a6962ac713e719
22 changes: 15 additions & 7 deletions src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@

if (repo.resolve(ref) != null) {
// ref is either an existing reference or a shortcut to a tag or branch (without refs/heads/)
git(repo).checkout().setName(ref).setForce(true).call();
git(repo).checkout().setName(ref).setForceRefUpdate(true).call();
return;
}

Expand Down Expand Up @@ -550,7 +550,7 @@
.checkout()
.setName(branch)
.setCreateBranch(true)
.setForce(true)
.setForceRefUpdate(true)
.setStartPoint(ref)
.call();
} catch (GitAPIException e) {
Expand Down Expand Up @@ -2063,7 +2063,11 @@
}
final boolean found;
try (Repository repo = getRepository()) {
found = repo.hasObject(commit);
try {
found = repo.getObjectDatabase().has(commit);
} catch (IOException ioe) {
throw new GitException(ioe);

Check warning on line 2069 in src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 2068-2069 are not covered by tests
}
}
return found;
}
Expand Down Expand Up @@ -2903,7 +2907,7 @@

Map<ObjectId, Ref> tags = new HashMap<>();
for (Ref r : repo.getTags().values()) {
ObjectId key = repo.peel(r).getPeeledObjectId();
ObjectId key = repo.getRefDatabase().peel(r).getPeeledObjectId();
if (key == null) {
key = r.getObjectId();
}
Expand Down Expand Up @@ -3157,9 +3161,13 @@
String tagName = entry.getKey();
Ref tagRef = entry.getValue();
if (!tagRef.isPeeled()) {
Ref peeledRef = repo.peel(tagRef);
if (peeledRef.getPeeledObjectId() != null) {
tagRef = peeledRef; // Use peeled ref instead of annotated ref
try {
Ref peeledRef = repo.getRefDatabase().peel(tagRef);
if (peeledRef.getPeeledObjectId() != null) {
tagRef = peeledRef; // Use peeled ref instead of annotated ref
}
} catch (IOException ioe) {
throw new GitException(ioe);

Check warning on line 3170 in src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 3169-3170 are not covered by tests
}
}
/* Packed lightweight (non-annotated) tags can wind up peeled with no peeled obj ID */
Expand Down