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

Integrated code lifecycle: Unify ssh usage config condition for build agents #10293

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

jfr2102
Copy link

@jfr2102 jfr2102 commented Feb 8, 2025

Checklist

General

Server

Motivation and Context

While trying to find right configuration values I found the current behaviour of config artemis.version-control.build-agent-use-ssh quite confusing.
artemis.version-control.build-agent-use-ssh actually only controls wether a keypair will be generated at the startup of an buildagent and what the getPublicKeyAsString() method returns (this result is stored in the hazelcast map where core nodes can read it).

However, the actual condition wether the build agent will configure ssh in the BuildJobGitService currently depends on the useSsh() method in the parent AbstractGitService which returns true if the 2 configuration values ssh-host-key-path and ssh-template-clone-url are present.

Currently configuringbuild-agent-use-ssh: false but ssh-host-key-path and ssh-template-clone-url being present will not create a keypair, and not push the public key into the hazelcast store, but still try configure ssh on the build agent.

If keys get manually generated in the configured ssh-template-clone-url and this build-agent-use-ssh is supposed to just prevent the creation of a new key then build-agent-use-ssh:false would also prevent public key being put into hazelcast (because getPublicKeyAsString() returns null then.) Which seems weird.

Description

I suggest to override useSsh() in BuildJobGitService to check on configuration build-agent-use-ssh to be consistent with the conditions for generating the keypair and throwing a RuntimeException if build-agent-use-ssh:true but no ssh-template-clone-url is set

Steps for Testing

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) buildagent Pull requests that affect the corresponding module labels Feb 8, 2025
@jfr2102 jfr2102 changed the title use ssh in BuildJobGitService if build-agent-use-ssh: true Integrated Code Lifecycle: use ssh in BuildJobGitService if build-agent-use-ssh: true Feb 8, 2025
@jfr2102 jfr2102 changed the title Integrated Code Lifecycle: use ssh in BuildJobGitService if build-agent-use-ssh: true Integrated code lifecycle: use ssh in BuildJobGitService if build-agent-use-ssh: true Feb 8, 2025
@jfr2102 jfr2102 changed the title Integrated code lifecycle: use ssh in BuildJobGitService if build-agent-use-ssh: true Integrated code lifecycle: Unify ssh config for build agents Feb 8, 2025
@jfr2102 jfr2102 changed the title Integrated code lifecycle: Unify ssh config for build agents Integrated code lifecycle: Unify ssh config for build agents Feb 8, 2025
@jfr2102 jfr2102 changed the title Integrated code lifecycle: Unify ssh config for build agents Integrated code lifecycle: Unify ssh usage condition for build agents Feb 14, 2025
@jfr2102 jfr2102 changed the title Integrated code lifecycle: Unify ssh usage condition for build agents Integrated code lifecycle: Unify ssh usage config condition for build agents Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buildagent Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!)
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

1 participant