jenkins-infra / helpdesk

Open your Infrastructure related issues here for the Jenkins project
https://github.com/jenkins-infra/helpdesk/issues/new/choose
16 stars 10 forks source link

jgit cloning not converting line ends on windows? #3865

Open jtnord opened 8 months ago

jtnord commented 8 months ago

Service(s)

ci.jenkins.io

Summary

https://github.com/jenkinsci/google-oauth-plugin/pull/209/ fails in CI on windows as it appears all the files have UNIX line endings.

https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgoogle-oauth-plugin/detail/PR-209/1/pipeline/79/#step-98-log-14 appears to show that the clone/fetch of the project is done by jgit and not git. this could be a case of a) misreporting by sportless (but it affects 50 files which is every single java file in src/main) b) spotless is not pickup up where the global/system config should be and is assuming they should be \n and are \r\n (they have been converted) c) jgit is not pickup up where the global/system config should be and not converting the files d) the option is not configured - so there is no conversion and spotless falls back to expecting native line end. e) something is very messed up in the project (but it works locally on windows). f) jgit plugin ignores settings from the agent and need to be specified in code.

without some access to the node it is not possible to diagnose for a plugin developer what is wrong here, but it seems to not be completely widespread.

Reproduction steps

No response

jtnord commented 8 months ago

was worked around by switching to container agents - so this could be something specific to the VMs (in Azure?)

dduportal commented 8 months ago

was worked around by switching to container agents - so this could be something specific to the VMs (in Azure?)

Thanks for the pointer (sorry for the delay, today was really busy for the whole team).

It make sense as we have not (yet) unified Windows VM and container images:

@jtnord I do not know which setting to look for: I guess since it is jgit it could be a general Windows setting, a git (installlation) setting or even a Java setting?

jonesbusy commented 8 months ago

Similar issue here : https://ci.jenkins.io/job/Plugins/job/locale-plugin/job/main/83/console after I formatted the plugin and updated Jenkinsfile

Was a mistake to build on VM. Fixed by using useContainerAgent: true.

So behavior is definitely not the same between Windows VM and container agent