Skip to content

Conversation

@jeromepochat
Copy link
Contributor

A regression around GitHubAppCredentials.withOwner was introduced since #796.

As a follow-up to the fix, this adds non regression test.

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

A unit test, OK. What we would really like is an integration test with WireMock of running a multibranch pipeline and having the various involved plugins wire through the Run context that allows withOwner to be called with the right value. That would be a lot more work of course.

private static LogRecorder logRecorder;

// https://stackoverflow.com/a/22176759/4951015
public static final String PKCS8_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n"
Copy link
Contributor Author

@jeromepochat jeromepochat Sep 27, 2024

Choose a reason for hiding this comment

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

Extracted to GitHubApp for reuse from multiple test classes.

@jeromepochat
Copy link
Contributor Author

jeromepochat commented Sep 27, 2024

👀 why the new test is failing on windows but pass on linux.

@jeromepochat jeromepochat requested a review from jglick September 30, 2024 09:52
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Thanks!

multiBranchProject.scheduleBuild2(0, new Action[0]).getFuture().get();

final var branchProject = multiBranchProject.getItem("master");
assertThat(branchProject, notNullValue());
Copy link
Member

Choose a reason for hiding this comment

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

And without the fix, is this the line that fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And without the fix, is this the line that fails?

Yes. I confirm that the test is failing without #803

Comment on lines +9 to +10
private static final String PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n"
+
Copy link
Member

Choose a reason for hiding this comment

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

BTW when updating to 2.479.x we can switch to a multiline text block which would be more legible.

@jglick jglick merged commit 11ce4fe into jenkinsci:master Oct 8, 2024
@jeromepochat jeromepochat deleted the JENKINS-73474 branch October 8, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants