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

Restore ability of publishIssues to run without a workspace #1727

Merged
merged 6 commits into from
Apr 15, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented Apr 11, 2024

Fixes a recent regression #1669 (comment) #1679 (comment) because

@Override
public Set<Class<?>> getRequiredContext() {
return Sets.immutable.of(FlowNode.class, Run.class, TaskListener.class).castToSet();
}
does not require a workspace.

Without fix, test fails as observed in a real controller:

Error
java.lang.AssertionError: 
unexpected build status; build log was:
------
Started
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in …/workspace/p
[Pipeline] {
[Pipeline] scanForIssues
[Eclipse ECJ] Searching for all files in '…/workspace/p' that match the pattern 'x.txt'
[Eclipse ECJ] Traversing of symbolic links: enabled
[Eclipse ECJ] -> found 1 file
[Eclipse ECJ] Successfully parsed file …/workspace/p/x.txt
[Eclipse ECJ] -> found 8 issues (skipped 0 duplicates)
[Eclipse ECJ] Successfully processed file 'x.txt'
[Eclipse ECJ] Post processing issues on 'Master' with source code encoding 'UTF-8'
[Eclipse ECJ] Creating SCM blamer to obtain author and commit information for affected files
[Eclipse ECJ] -> no SCM found
[Eclipse ECJ] Resolving file names for all issues in workspace '…/workspace/p'
[Eclipse ECJ] -> resolved paths in source directory (0 found, 4 not found)
[Eclipse ECJ] Resolving module names from module definitions (build.xml, pom.xml, or Manifest.mf files)
[Eclipse ECJ] -> resolved module names for 8 issues
[Eclipse ECJ] Resolving package names (or namespaces) by parsing the affected files
[Eclipse ECJ] -> resolved package names of 4 affected files
[Eclipse ECJ] No filter has been set, publishing all 8 issues
[Eclipse ECJ] Creating fingerprints for all affected code blocks to track issues over different builds
[Eclipse ECJ] -> created fingerprints for 0 issues (skipped 8 issues)
[Eclipse ECJ] Copying affected files to Jenkins' build folder '…/jobs/p/builds/1/files-with-issues'
[Eclipse ECJ] -> 0 copied, 0 not in workspace, 8 not-found, 0 with I/O error
[Eclipse ECJ] Skipping cleaning of source code files in old builds
[Eclipse ECJ] Repository miner is not configured, skipping repository mining
[Eclipse ECJ] [-ERROR-] Can't create fingerprints for some files:
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/AttributeException.java' file not found
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/gui/swt/SWTTextBuilder.java' file not found
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/gui/swt/SWTTextBuilder.java' file not found
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/gui/swt/SWTTextBuilder.java' file not found
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/gui/swt/SWTTextBuilder.java' file not found
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/gui/swt/SWTTextBuilder.java' file not found
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/reflect/ObjectReflectionException.java' file not found
[Eclipse ECJ] [-ERROR-] - 'C:/Desenvolvimento/Java/jfg/src/jfg/reflect/ObjectReflectionGroup.java' file not found
[Pipeline] }
[Pipeline] // node
[Pipeline] publishIssues
[Pipeline] End of Pipeline
Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: …
java.io.IOException: No workspace available for io.jenkins.plugins.analysis.core.steps.PublishIssuesStep$Execution@7c6ced86
	at io.jenkins.plugins.analysis.core.steps.AnalysisExecution.getWorkspace(AnalysisExecution.java:99)
	at io.jenkins.plugins.analysis.core.steps.PublishIssuesStep$Execution.run(PublishIssuesStep.java:415)
	at io.jenkins.plugins.analysis.core.steps.PublishIssuesStep$Execution.run(PublishIssuesStep.java:372)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Finished: FAILURE

------

Expected: is <SUCCESS>
     but: was <FAILURE>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1502)
	at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1508)
	at org.jvnet.hudson.test.JenkinsRule.buildAndAssertStatus(JenkinsRule.java:1555)
	at org.jvnet.hudson.test.JenkinsRule.buildAndAssertSuccess(JenkinsRule.java:1541)
	at io.jenkins.plugins.analysis.warnings.steps.PublishIssuesStepTest.noWorkspace(PublishIssuesStepTest.java:21)

@jglick jglick mentioned this pull request Apr 11, 2024
Vlatombe and others added 2 commits April 12, 2024 14:44
BuildWatcher doesn't seem to be supported yet in Junit5 execution mode
so removed it.
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.45%. Comparing base (095ef11) to head (20d1aa8).

❗ Current head 20d1aa8 differs from pull request most recent head a7f4f75. Consider uploading reports for the commit a7f4f75 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1727      +/-   ##
============================================
- Coverage     82.50%   82.45%   -0.06%     
+ Complexity     1349     1348       -1     
============================================
  Files           248      248              
  Lines          5208     5209       +1     
  Branches        400      401       +1     
============================================
- Hits           4297     4295       -2     
- Misses          804      806       +2     
- Partials        107      108       +1     

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

@uhafner uhafner added the bug Bugs or performance problems label Apr 15, 2024
@uhafner uhafner merged commit 448b15a into jenkinsci:main Apr 15, 2024
26 of 28 checks passed
@jglick jglick deleted the publishIssues branch April 15, 2024 11:13
@jglick
Copy link
Member Author

jglick commented Apr 15, 2024

Moved in 4efc2dc FTR

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.

4 participants