Skip to content

Initialize Git LFS for jenkins user#2348

Open
ParineethG wants to merge 1 commit into
jenkinsci:masterfrom
ParineethG:fix-git-lfs-jenkins-user
Open

Initialize Git LFS for jenkins user#2348
ParineethG wants to merge 1 commit into
jenkinsci:masterfrom
ParineethG:fix-git-lfs-jenkins-user

Conversation

@ParineethG
Copy link
Copy Markdown

Git LFS was initialized before switching to the jenkins user, which applies the configuration only for the root user.

This change initializes Git LFS after switching to the jenkins user so Git LFS configuration is available in the Jenkins runtime environment.

@ParineethG ParineethG requested a review from a team as a code owner May 20, 2026 15:36
Copy link
Copy Markdown
Contributor

@dduportal dduportal left a comment

Choose a reason for hiding this comment

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

Hello 👋 thanks for this change request!

It looks like you're in the correct direction but there still have a few elements:

  • Can you reference the issue describing the problem you're trying to solve please?
    • Also: is the issue author aware and ok for you to take over this contribution?
  • You only updated the Alpine Linux container image: you must also apply feature parity on all other images (Debian, Redhat, Windows, etc.)
  • Can you add a test in the test harness (expecting the test to fail without this instruction, and passing in this PR)

Comment thread alpine/hotspot/Dockerfile
COPY --from=jre-and-war /war/jenkins.war /usr/share/jenkins/jenkins.war

USER ${user}
RUN git lfs install
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
RUN git lfs install
# Execute as 'jenkins' (or name specified with $user to avoid root-only setup)
RUN git lfs install

Nit: adding a comment ensures that this RUN instructions remains after the USER step

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

issue #2348

Thanks for the feedback! I’ve now applied the same Git LFS initialization logic to the Alpine, Debian, and RHEL images where git-lfs is installed.

I’m also looking into the existing test harness to understand the best way to add coverage for this behavior.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the review and feedback!

I’ve now applied the Git LFS initialization change across the Alpine, Debian, and RHEL images where git-lfs is installed.

The Linux image test suites are passing successfully. I also noticed a failing Windows test in CI, though I currently do not have access to the detailed Jenkins logs to determine whether it is directly related to this change.

I’m continuing to look into the existing test harness for adding coverage around Git LFS initialization behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You have not pushed the last changes so we cannot see them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants