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

[JENKINS-73164] Fix record issues step ignores source code retention parameter #1809

Conversation

sirine707
Copy link
Contributor

  • Fix the recordIssues step to correctly honor the sourceCodeRetention parameter.
  • Added a test to verify that source code is not copied when sourceCodeRetention: 'NEVER'` is set.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

correctly handle the sourceCodeRetention parameter
The test ensures that the plugin adheres to the retention policy and properly cleans up files after the build
@uhafner uhafner added the bug Bugs or performance problems label Aug 14, 2024
Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

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

Almost done. Thanks for the PR!

sirine707 and others added 2 commits August 14, 2024 12:10
…s/StepsOnAgentITest.java


fixed comment typo

Co-authored-by: Ullrich Hafner <ullrich.hafner@gmail.com>
…s/StepsOnAgentITest.java


deleted

Co-authored-by: Ullrich Hafner <ullrich.hafner@gmail.com>
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.65%. Comparing base (8dc0054) to head (0b30364).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1809      +/-   ##
============================================
+ Coverage     82.55%   82.65%   +0.09%     
- Complexity     1352     1355       +3     
============================================
  Files           248      248              
  Lines          5212     5213       +1     
  Branches        401      401              
============================================
+ Hits           4303     4309       +6     
+ Misses          801      796       -5     
  Partials        108      108              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 80 to 84
final FilePath workspace, final Set<String> sourceDirectories,
final SourceCodeRetention sourceCodeRetention, final Run<?, ?> run,
final FilePath jenkinsRootDir, final TaskListener listener,
final String scm, final BlameMode blameMode, final PostProcessingMode postProcessingMode,
final boolean quiet) {
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid unrelated changes

@@ -139,8 +129,7 @@ private AnnotatedReport postProcessReport(final Report report) throws IOExceptio
AnnotatedReport result = workspace.act(createPostProcessor(report));
copyAffectedFiles(result.getReport(), createAffectedFilesFolder(result.getReport()));
return result;
}
else {
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid unrelated changes

@@ -164,8 +153,7 @@ private Blamer createBlamer(final Report report) {
if (blameMode == BlameMode.DISABLED) {
report.logInfo("Skipping SCM blames as requested");
return new NullBlamer();
}
else {
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid unrelated changes

@@ -346,8 +331,7 @@ private void resolvePackageNames(final Report report) {
try {
PackageNameResolver resolver = new PackageNameResolver();
resolver.run(report, getCharset());
}
catch (InvalidPathException exception) {
} catch (InvalidPathException exception) {
Copy link
Member

Choose a reason for hiding this comment

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

It seems you reformatted the whole source with the wrong style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its the intellij on gitpod who keeps doing it , I disabled the default settings but each time I have the same update of white spaces when I added the else block,
do I update the formatting of else and catch to its original and I commit again ?

Copy link
Member

Choose a reason for hiding this comment

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

Compare your changes with main and revert everything that is unrelated.

@@ -90,13 +89,36 @@ void shouldRecordOutputOfParallelSteps() {
if (JAVA_ID.equals(actions.get(0).getId())) {
first = actions.get(0);
second = actions.get(1);
}
else {
} else {
Copy link
Member

Choose a reason for hiding this comment

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

see above

@uhafner uhafner merged commit 4091749 into jenkinsci:main Aug 17, 2024
40 checks passed
@uhafner
Copy link
Member

uhafner commented Aug 17, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs or performance problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants