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

[ci] Custom revision parameter for Jenkins jobs #3419

Conversation

dliappis
Copy link

This commit introduces a REVISION parameter (when clicking Build With Parameters) to help running adhoc Jenkins builds with a specific revision.

It can be useful for re-producing failures similar to elastic/beats#35803

This commit introduces a REVISION parameter (when clicking
Build With Parameters) to help running adhoc Jenkins builds with a
specific revision.
@dliappis dliappis requested a review from a team as a code owner September 14, 2023 15:18
@mergify
Copy link
Contributor

mergify bot commented Sep 14, 2023

This pull request does not have a backport label. Could you fix it @dliappis? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@elastic-sonarqube
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

steps {
pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ])
deleteDir()
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true)
gitCheckout(basedir: "${BASE_DIR}", branches: [[name: "${params.REVISION}"]], githubNotifyFirstTimeContributor: true)
Copy link
Member

Choose a reason for hiding this comment

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

This is changing the default behaviour, if REVISION is optional, then, I'd say to keep the default behaviour if empty and checkout the given branch otherwise.

On the other hand, branches is not a valid argument for the gitCheckout -> https://github.com/elastic/apm-pipeline-library/tree/main/vars#gitcheckout

Suggested change
gitCheckout(basedir: "${BASE_DIR}", branches: [[name: "${params.REVISION}"]], githubNotifyFirstTimeContributor: true)
whenTrue("$REVISION" != "") {
gitCheckout(basedir: "${BASE_DIR}", branch: "${REVISION}", githubNotifyFirstTimeContributor: true)
}
whenFalse("$REVISION" != "") {
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true)
}

Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

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

This commit introduces a REVISION parameter (when clicking Build With Parameters) to help running adhoc Jenkins builds with a specific revision.

Will creating a PR from any given commit could help with? Or even creating a branch in elastic/elastic-agent for the given commit replace this particular implementation?

By doing so, there is no need to interact with Jenkins but wait for the outcome. If using PRs then, the GitHub comment with the build result could help with.

Just an idea

@dliappis
Copy link
Author

This commit introduces a REVISION parameter (when clicking Build With Parameters) to help running adhoc Jenkins builds with a specific revision.

Will creating a PR from any given commit could help with? Or even creating a branch in elastic/elastic-agent for the given commit replace this particular implementation?

By doing so, there is no need to interact with Jenkins but wait for the outcome. If using PRs then, the GitHub comment with the build result could help with.

Just an idea

@v1v This sounds like a great idea! In addition, given that #3411 seems to have addressed the issue that triggered this need, I think it might be best to close this PR.
Thank you for the guidance in #3419 (comment), highly appreciated!

@dliappis dliappis closed this Sep 14, 2023
@elasticmachine
Copy link
Contributor

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-09-14T15:19:12.847+0000

  • Duration: 81 min 44 sec

Test stats 🧪

Test Results
Failed 3
Passed 11005
Skipped 116
Total 11124

Test errors 3

Expand to view the tests failures

extended windows / Matrix - PLATFORM = 'windows-8' / Test / TestRemovePath – github.com/elastic/elastic-agent/internal/pkg/agent/install
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestRemovePath
        uninstall_windows_test.go:52: 
            	Error Trace:	C:/Users/jenkins/workspace/_agent_elastic-agent-mbp_PR-3419/src/github.com/elastic/elastic-agent/internal/pkg/agent/install/uninstall_windows_test.go:52
            	Error:      	Received unexpected error:
            	            	failed to open handle for "testblocking\\TestRemovePath26770428\\testblocking.exe": The process cannot access the file because it is being used by another process.
            	Test:       	TestRemovePath
    --- FAIL: TestRemovePath (0.04s)
     
    

extended windows / Matrix - PLATFORM = 'windows-10' / Test / TestProgress/single_step_delayed_failure – github.com/elastic/elastic-agent/internal/pkg/agent/install
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestProgress/single_step_delayed_failure
        progress_test.go:59: 
            	Error Trace:	C:/Users/jenkins/workspace/_agent_elastic-agent-mbp_PR-3419/src/github.com/elastic/elastic-agent/internal/pkg/agent/install/progress_test.go:59
            	Error:      	Expect "step 1 starting... FAILED
            	            	" to match "step 1 starting\.{3}\.+ FAILED\n"
            	Test:       	TestProgress/single_step_delayed_failure
    --- FAIL: TestProgress/single_step_delayed_failure (0.02s)
     
    

extended windows / Matrix - PLATFORM = 'windows-10' / Test / TestProgress – github.com/elastic/elastic-agent/internal/pkg/agent/install
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestProgress
    --- FAIL: TestProgress (0.15s)
     
    

Steps errors 4

Expand to view the steps failures

Go unitTest
  • Took 7 min 50 sec . View more details here
  • Description: mage unitTest
Checks if running on a Unix-like node
  • Took 0 min 0 sec . View more details here
  • Description: script returned exit code 1
Go unitTest
  • Took 11 min 9 sec . View more details here
  • Description: mage unitTest
Checks if running on a Unix-like node
  • Took 0 min 0 sec . View more details here
  • Description: script returned exit code 1

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 3

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: extended windows / Matrix - PLATFORM = 'windows-8' / Test / TestRemovePath – github.com/elastic/elastic-agent/internal/pkg/agent/install
  • Name: extended windows / Matrix - PLATFORM = 'windows-10' / Test / TestProgress/single_step_delayed_failure – github.com/elastic/elastic-agent/internal/pkg/agent/install
  • Name: extended windows / Matrix - PLATFORM = 'windows-10' / Test / TestProgress – github.com/elastic/elastic-agent/internal/pkg/agent/install

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.78% (81/82) 👍
Files 66.327% (195/294) 👍
Classes 65.751% (359/546) 👍
Methods 52.76% (1128/2138) 👍
Lines 38.225% (12805/33499) 👎 -0.03
Conditionals 100.0% (0/0) 💚

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

Successfully merging this pull request may close these issues.

3 participants