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

Correct environment support + upgrade dependencies #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chadlwilson
Copy link

Fixes #20 by ensuring the GoCD-instructed environment is auto-registered by the agent. The plugin currently breaks the contract with GoCD which causes some confusion for users; see https://groups.google.com/g/go-cd/c/PAzY8Cw7Mxk/m/9Hbj8Fp9BAAJ

The fix is pretty simple given the current plugin design. Note that this change adds a warning in the job log if users have used the previous hacks to try and get environment support to work.

Also

  • upgrades all the dependencies to ones without vulnerabilities in transitives
  • otherwise ensures it can be built and work on Java 11 with modern Gradle. GocD itself has only supported Java 11+ for many years now.
  • removes some dead code that has dependency on unnecessary libraries

The plugin currently breaks the contract by not respecting the environment GoCD tells it to create an agent in. This can cause agents/instances to spin up that never get assigned jobs, and in some cases agents to get assigned jobs that they should not, due to hacks users use to set the environment with custom user data.

This implements what is needed with a standard GoCD agent to conform to the spec at https://plugin-api.gocd.org/current/elastic-agents/#create-agent
Tests still fail though, some seem to depend on being able to do real stuff on AWS.
- Resolves vulnerabilities in transitive dependencies
- Rationalises unneeded dependencies
@chadlwilson
Copy link
Author

@adrian-iriusrisk Is this something you're willing to evaluate and merge? PR looks a little big due to rationalising/removing commons-lang and some other dependencies that came over from the plugin template this was based on, but it should be reasonably straightforward. 🙏

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.

Pipeline was not running over EC2 Elastic Agent
1 participant