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

[SCM-937] replace deprecated methods #101

Merged
merged 4 commits into from
May 21, 2020
Merged

[SCM-937] replace deprecated methods #101

merged 4 commits into from
May 21, 2020

Conversation

elharo
Copy link
Contributor

@elharo elharo commented May 10, 2020

@elharo elharo requested a review from eolivelli May 10, 2020 23:19
BufferedReader r = new BufferedReader( new FileReader( gitlog ) );

try
try ( BufferedReader r = new BufferedReader( new FileReader( gitlog ) ) )
Copy link
Member

Choose a reason for hiding this comment

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

We should create another issue here because it is subject to character conversion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. fixed.

@elharo
Copy link
Contributor Author

elharo commented May 11, 2020

Seeing some flakiness in our windows builds for this plugin in multiple PRs:

Error Message

Command failed.The svn tag command failed.

Stacktrace

org.apache.maven.plugin.MojoExecutionException: Command failed.The svn tag command failed.
at org.apache.maven.scm.plugin.TagMojoTest.testTag(TagMojoTest.java:93)

Standard Output

Test command line: cmd.exe /X /C "svnadmin create repository"
[INFO] Removing F:\jenkins\jenkins-slave\workspace\maven-box_maven-scm_i937\m\maven-scm-plugin\target\checkout
[INFO] Executing: cmd.exe /X /C "svn --non-interactive checkout file:///F:/jenkins/jenkins-slave/workspace/maven-box_maven-scm_i937/m/maven-scm-plugin/target/repository/trunk@ F:\jenkins\jenkins-slave\workspace\maven-box_maven-scm_i937\m\maven-scm-plugin\target\checkout"
[INFO] Working directory: F:\jenkins\jenkins-slave\workspace\maven-box_maven-scm_i937\m\maven-scm-plugin\target
[INFO] Final Tag Name: 'mytag'
[INFO] Executing: cmd.exe /X /C "svn --non-interactive copy --file C:\Windows\system32\config\systemprofile\AppData\Local\Temp\maven-scm-173513893.commit --encoding UTF-8 --parents . file:///F:/jenkins/jenkins-slave/workspace/maven-box_maven-scm_i937/m/maven-scm-plugin/target/repository/tags/mytag@"
[INFO] Executing: cmd.exe /X /C "svn --non-interactive copy --file C:\Windows\system32\config\systemprofile\AppData\Local\Temp\maven-scm-173513893.commit --encoding UTF-8 --parents . file:///F:/jenkins/jenkins-slave/workspace/maven-box_maven-scm_i937/m/maven-scm-plugin/target/repository/tags/mytag@"
[INFO] Working directory: F:\jenkins\jenkins-slave\workspace\maven-box_maven-scm_i937\m\maven-scm-plugin\target\checkout
[INFO] Working directory: F:\jenkins\jenkins-slave\workspace\maven-box_maven-scm_i937\m\maven-scm-plugin\target\checkout
[ERROR] Provider message:
[ERROR] The svn tag command failed.
[ERROR] Command output:
[ERROR] svn: E720003: Can't open file 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\maven-scm-173513893.commit': The system cannot find the path specified.

@michael-o
Copy link
Member

michael-o commented May 11, 2020

This cannot be real: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\maven-scm-173513893.commit

Writing into C:\Windows is just wrong. I have this dir on my machine: C:\WINDOWS\System32\config\systemprofile\AppData. It seems like Jenkins runs a some system account. Temp does not exist.
There it is: https://superuser.com/a/598626
We need to file an issue with INFRA to create the Temp dir. After that the test should pass.

@@ -52,7 +53,8 @@
{
GitStatusConsumer consumer = new GitStatusConsumer( new DefaultLog(), null, relativeRepoPath );

try ( BufferedReader r = new BufferedReader( new FileReader( gitlog ) ) )
try ( BufferedReader r = new BufferedReader(
new InputStreamReader ( new FileInputStream( gitlog ), StandardCharsets.UTF_8 ) ) )
Copy link
Member

Choose a reason for hiding this comment

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

I don't know whether this is better. If we read from stdin or the stdin has been redirected and the encoding was not UTF-8 and did contain multibyte characters the reader will show errors.

Copy link
Contributor Author

@elharo elharo left a comment

Choose a reason for hiding this comment

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

#99 to update Plexus didn't flake, so possibly the plexus-utils update there fixes this?

@michael-o
Copy link
Member

#99 to update Plexus didn't flake, so possibly the plexus-utils update there fixes this?

I don't think. It might be node specific that Temp does exist. I would still inquire with INFRA first.

Copy link
Contributor Author

@elharo elharo left a comment

Choose a reason for hiding this comment

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

If it's the Temp directory that's at fault, there might be a way to avoid that.

@michael-o
Copy link
Member

If it's the Temp directory that's at fault, there might be a way to avoid that.

What is your proposal then?

@elharo elharo merged commit 9074518 into master May 21, 2020
@elharo elharo deleted the i937 branch May 21, 2020 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants