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

Migrate Jenkinsfile 2 GH Actions Workflow #1731

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Jan 30, 2023

What does this pull request do?

Migrate Jenkinsfile to GH Actions Workflow.

Release flow

As agreed, the release will be automatically triggered on every push of a tag with the pattern v*.*.*.

image

Follow-ups

Related issues

Closes https://github.com/elastic/observability-robots/issues/1515

@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Jan 30, 2023
@apmmachine
Copy link
Contributor

apmmachine commented Jan 30, 2023

💚 Build Succeeded

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

Expand to view the summary

Build stats

  • Start Time: 2023-02-06T08:34:47.385+0000

  • Duration: 18 min 44 sec

Test stats 🧪

Test Results
Failed 0
Passed 5086
Skipped 3679
Total 8765

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /test linters : Run the Python linters only.

  • /test full : Run the full matrix of tests.

  • /test benchmark : Run the APM Agent Python benchmarks tests.

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

@apmmachine
Copy link
Contributor

apmmachine commented Jan 30, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (73/73) 💚
Files 100.0% (241/241) 💚
Classes 100.0% (241/241) 💚
Lines 91.887% (18766/20423) 👎 -0.034
Conditionals 74.941% (2880/3843) 👎 -0.104

@reakaleek
Copy link
Member Author

Coverage Report will be handled in a follow-up. See https://github.com/elastic/observability-robots/issues/1546

@reakaleek reakaleek force-pushed the feature/migrate-jenkinsfile-2-gh-actions-workflow branch 3 times, most recently from 6c6e6e9 to 51758b1 Compare February 2, 2023 12:29
@@ -0,0 +1,48 @@
name: release

on:
Copy link
Member Author

Choose a reason for hiding this comment

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

As agreed, will be triggered on every push of a tag

@@ -273,32 +247,6 @@ pipeline {
}
}
}
stage('Opbeans') {
Copy link
Member Author

Choose a reason for hiding this comment

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

As agreed with @v1v, this stage will be moved to the consumer side.

Copy link
Member Author

Choose a reason for hiding this comment

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

@reakaleek
Copy link
Member Author

Coverage Report will be handled in a follow-up.

uses: elastic/apm-pipeline-library/.github/actions/version-framework@current
with:
# Use .ci/.jenkins_python_full.yml if it's a scheduled workflow, otherwise use .ci/.jenkins_python.yml
versionsFile: .ci/.jenkins_python${{ github.event_name == 'schedule' && '_full' || '' }}.yml
Copy link
Member Author

Choose a reason for hiding this comment

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

This replaces the nightly test.

@reakaleek reakaleek force-pushed the feature/migrate-jenkinsfile-2-gh-actions-workflow branch from e852c6e to b084342 Compare February 2, 2023 14:28
@reakaleek reakaleek force-pushed the feature/migrate-jenkinsfile-2-gh-actions-workflow branch from 4d5d92c to 9e75a91 Compare February 2, 2023 14:41
@reakaleek reakaleek requested review from a team February 2, 2023 14:48
@reakaleek reakaleek marked this pull request as ready for review February 2, 2023 14:48
@@ -19,7 +19,7 @@
repo: apm-agent-python
repo-owner: elastic
credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken
head-filter-regex: '^(main|PR-.*|[5-9]\.x|v[0-9].*)$'
Copy link
Member Author

Choose a reason for hiding this comment

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

This will make the jenkins jobs only run on the tag event and will be omitted on main and pull requests.

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.

LGTM, just a couple of minor questions

Comment on lines 15 to 16
schedule:
- cron: '0 2 * * *'
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for this?

Copy link
Member Author

@reakaleek reakaleek Feb 2, 2023

Choose a reason for hiding this comment

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

In Jenkins there was a nightly job that runs the full matrix. Here it's solved with this: #1731 (comment)

Copy link
Member Author

@reakaleek reakaleek Feb 2, 2023

Choose a reason for hiding this comment

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

Okay.. I just noticed it's the wrong file and a copy pasta error. 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

.github/workflows/snapshoty.yml Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved

jobs:
packages:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
Copy link
Member Author

Choose a reason for hiding this comment

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

This way it only runs when the test workflow in main was successul.

@reakaleek reakaleek requested a review from v1v February 6, 2023 08:23
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.

LGTM, with just a minor question regarding workflows, calls and the download step

Comment on lines +29 to +32
- uses: actions/download-artifact@v3
with:
name: packages
path: dist
Copy link
Member

Choose a reason for hiding this comment

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

Question regarding this step:

  • Will this step ensure the package to be downloaded is the one produced in the .github/workflows/package.yml?

Just wondering if two parallel workflows run (one for the merge commit in main and another one for the git tag vx.x.x), won't be any overlap between them?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good question, I had the assumption that if the packages workflow is a sub workflow of release, that the release will the download the artifacts only from the sub workflow. I will try to verify this in a sample repo

Copy link
Member Author

@reakaleek reakaleek Feb 6, 2023

Choose a reason for hiding this comment

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

Alright, I did some testing on a private playground repo:

Given a workflow with push trigger that uploads some artifacts and given a release workflow with a tag trigger, that tries to download the same artifact name. Then the following error shows:

image

Downloading the artifact only worked if the workflows are "connected" like we are doing it here.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for verifying this! 👍

Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

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

Looks great!

@reakaleek reakaleek self-assigned this Feb 7, 2023
@reakaleek reakaleek merged commit a54a3ae into elastic:main Feb 7, 2023
@reakaleek reakaleek deleted the feature/migrate-jenkinsfile-2-gh-actions-workflow branch February 7, 2023 07:55
beniwohli pushed a commit to beniwohli/apm-agent-python that referenced this pull request Feb 16, 2023
* Migrate Jenkinsfile to GH Actions

* Generic naming

* Upload junit test and coverage reports on success or on failure

* Better naming

* Remove cron from packages workflow

* Rename all occurences of WEBFRAMEWORK to FRAMEWORK
basepi added a commit that referenced this pull request Feb 16, 2023
* handle case when no span is created in GRPC client interceptor

closes #1739

* Migrate Jenkinsfile 2 GH Actions Workflow (#1731)

* Migrate Jenkinsfile to GH Actions

* Generic naming

* Upload junit test and coverage reports on success or on failure

* Better naming

* Remove cron from packages workflow

* Rename all occurences of WEBFRAMEWORK to FRAMEWORK

* Add a warning about BaseHTTPMiddleware to Starlette docs (#1735)

* Add a warning about BaseHTTPMiddleware to Starlette docs

Also switch to using get_client() and make the docs simpler for
environment variable configuration.

* CHANGELOG

* Change `server_url` default to avoid ipv6 ambiguity (#1744)

* Change `server_url` default to avoid ipv6 ambiguity

* Fix failing test and another minor doc fix

* Add service.agent.activation_method to metadata (#1743)

* Add activation_method to metadata

* Add test

* Move activation_method default above start_threads

* CHANGELOG

* Fix nightly scheduled test (#1747)

* Split matrix items into chunks

to bypass the 256 limit of matrix items in github actions

* cleanup

* Add comments

* Add update-specs updatcli workflow (#1745)

* Add update-specs updatcli workflow

* Fix paths

* Required Status Check (#1749)

* Create single status check that can be set as required

* Let windows test runs exit with the correct exit code

* Set the exit code

* Formatting

* fix

* More readable jq query

* Set status check to success in case it's an only-docs PR (#1753)

* Set status check to success in case it's a only-docs PR

* Set permissions

* fix path patterns

* Add comments

* Update badge (#1752)

* Add dynamic config tag to more supported options (#1750)

* Fix sha source (#1754)

* update changelog

---------

Co-authored-by: Jan Calanog <nejcalanog@gmail.com>
Co-authored-by: Colton Myers <colton@basepi.net>
Co-authored-by: Jan Calanog <jan.calanog@elastic.co>
v1v added a commit that referenced this pull request Feb 27, 2023
@v1v v1v mentioned this pull request Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants