Integrated code lifecycle
: Unify ssh usage config condition for build agents
#10293
+20
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andssh-template-clone-url
are present.Currently configuring
build-agent-use-ssh: false
butssh-host-key-path
andssh-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 thisbuild-agent-use-ssh
is supposed to just prevent the creation of a new key thenbuild-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 configurationbuild-agent-use-ssh
to be consistent with the conditions for generating the keypair and throwing a RuntimeException ifbuild-agent-use-ssh:true
but nossh-template-clone-url
is setSteps 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
Manual Tests
Test Coverage
Screenshots