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

[JENKINS-51489] Use ATH pre configured plugins mode from essentialsTest #65

Merged
merged 6 commits into from
Jun 11, 2018

Conversation

raul-arabaolaza
Copy link
Contributor

@raul-arabaolaza raul-arabaolaza commented May 23, 2018

JENKINS-51489

Downstream of:

Modify essentialsTest so it uses the new pre configured plugins mode introduced in ATH#433

@reviewbybees @oleg-nenashev @jglick

Copy link
Contributor

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Just a UX concern. The implementation LGTM

@@ -2,6 +2,7 @@ def call(Map params = [:]) {
def baseDir = params.containsKey('baseDir') ? params.baseDir : "."
def metadataFile = params.containsKey('metadataFile') ? params.metadataFile : "essentials.yml"
def labels = params.containsKey('labels') ? params.labels : "docker && highmem"
def pluginEvaluationOutcome = params.get("pluginEvaluationOutcome") ?: "failOnInvalid"
Copy link
Contributor

Choose a reason for hiding this comment

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

The argument name cannot be understood bu a user without reading docs.
I would rather prefe...

metadata:
   testPluginResolution:
     skipOnUnmetDependencies: true

with defaulting to failOnInvalid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely, that makes it much more nicer, will update the PR

@@ -10,7 +11,9 @@ def call(Map params = [:]) {

dir(baseDir) {
def metadataPath = "${pwd()}/${metadataFile}"
metadata = readYaml(file: metadataPath)
def configData = readYaml(file: metadataPath)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The variable was lacking a def and I have changed the name of it to avoid having a metadata.metadata in the code which may be misleading, and I like the idea of a metadatasection in the yml file

@@ -10,7 +11,9 @@ def call(Map params = [:]) {

dir(baseDir) {
def metadataPath = "${pwd()}/${metadataFile}"
metadata = readYaml(file: metadataPath)
def configData = readYaml(file: metadataPath)
testPluginResolution = configData.metadata?.testPluginResolution?.skipOnUnmetDependencies ? "skipOnInvalid" : "failOnInvalid"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically this is allways failOnInvalid unless you have:

metadata:
  testPluginResolution:
    skipOnUnmetDependencies: true

@raul-arabaolaza
Copy link
Contributor Author

Some reasonable changes requested in the upstream PR, I am going to modify this a little bit to accommodate to the new code

@oleg-nenashev
Copy link
Contributor

Regarding metadata entry, it was rather a mistake from my side. I was about proposing

ath:
  testPluginResolution:
    skipOnUnmetDependencies: true

Having a separate section sounds reasonable anyway, because the same setting may be required for runATH() at some point. I just doubt that metadata is a best name since it's still a source of confusion with the "metadata file" term.

Not sure what would be a better name tho

@raul-arabaolaza
Copy link
Contributor Author

raul-arabaolaza commented May 28, 2018

@oleg-nenashev Yeah, I am all for a separate section because this is not intended to work on ath step alone, this setting makes sense in a concrete flow (essentials in this case) and the runATH already provides support for this kind of customization via the custom javaOptions parameter.

I am thinking on a flow section or something on that lines that can be used by shared libraries or Jenkinsfiles to get some metadata in order to customize a high level flow. essentialsTest is one of those. In that section you can add some semantic metadata like the testPluginResolution or something more generic like:

flow: 
  javaOptions:
    pct:
      - "-D..."
    ath: 
     - "-Djfjefjf"
  ath:
    testPluginResolution:
      skipOnUnmetDependencies: true

@raul-arabaolaza
Copy link
Contributor Author

@oleg-nenashev I had to fix some conflicts, all needed PR are already merged, can you re-bee this if you feel is worthwile?

Copy link
Contributor

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

After splitting the flow section to "ath" and "pct" I see no particular reason to keep it outside the main "ath" and "pct" sections. But whatever works

@raul-arabaolaza raul-arabaolaza merged commit 1034fc7 into jenkins-infra:master Jun 11, 2018
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