-
Notifications
You must be signed in to change notification settings - Fork 761
Add ATEX testing to the upstream CI workflows #14203
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
base: master
Are you sure you want to change the base?
Conversation
f1dae23 to
301dab3
Compare
|
From: https://github.com/ComplianceAsCode/content/actions/runs/19858710726/job/56915038821?pr=14203 I'm afraid the token will only be allowed to be used when we merge the pull request The same code with the same token is working fine on my fork: ggbecker#41 |
| @@ -0,0 +1,88 @@ | |||
| #!/usr/bin/python3 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #!/usr/bin/python3 | |
| #!/usr/bin/env python3 |
tests/run_tests_testingfarm.py
Outdated
| platform_name = f"cs{args.os_major_version}@{args.arch}" | ||
|
|
||
| # Hardware requirements for Testing Farm | ||
| # if args.arch == "x86_64": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code should be removed, we can keep in history if needed
tests/run_tests_testingfarm.py
Outdated
| @@ -0,0 +1,128 @@ | |||
| #!/usr/bin/python3 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #!/usr/bin/python3 | |
| #!/usr/bin/env python3 |
tests/run_tests_testingfarm.py
Outdated
| logger = logging.getLogger("ATEX") | ||
|
|
||
| # Parse command-line arguments | ||
| parser = argparse.ArgumentParser(description="Run tests on Testing Farm using atex") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So both of these script work, but are not structured like our other scripts (main method, parse_args, etc). Any reason for that? I would prefer that these scripts follow format of our other scripts.
.github/workflows/atex.yaml
Outdated
| libxslt-devel python3-setuptools gawk | ||
|
|
||
| - name: Install Python dependencies | ||
| run: pip install pcre2==0.4.0 -r requirements.txt -r test-requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we just want add pcre2 to test-requirements.txt?
.github/workflows/atex.yaml
Outdated
|
|
||
| - name: Download test results - CentOS Stream 9 | ||
| if: always() | ||
| uses: actions/download-artifact@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use hashes, check latest version
.github/workflows/atex.yaml
Outdated
|
|
||
| - name: Download test results - CentOS Stream 10 | ||
| if: always() | ||
| uses: actions/download-artifact@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use hashes, check latest version
.github/workflows/atex.yaml
Outdated
|
|
||
| - name: Checkout ATEX HTML viewer | ||
| if: always() | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use hashes, check latest version
|
|
||
| # do faster queries than the default 30 secs, because we don't track | ||
| # many dozens of requests, just one | ||
| class FastRequest(api.Request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a docstring for why this class is needed.
|
|
||
| - name: Run tests on Testing Farm | ||
| env: | ||
| TESTING_FARM_API_TOKEN: ${{ secrets.TESTING_FARM_API_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, this will never be available since we are using pull_request.
We might need break this out into two jobs. One that builds using pull_request, then a second one that uses workflow_run to trigger the tests.
Also added restrictions to token permissions as suggested by github.
Use env in the shebang for python scripts. Use fixed hash for github actions to prevent supply chain attacks. Remove dead code. Add pcre2 to the requirements.txt file.
|
I've addressed all the feedback provided and split the jobs into two workflows, one with the |
|
@ggbecker: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use hash, this applies other places in the PR, but I will not repeat.
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| name: pr-info-9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also be using the matrix? We do save this for all versions of RHEL.
| libxslt-devel python3-setuptools gawk | ||
|
|
||
| - name: Install Python dependencies | ||
| run: pip install pcre2==0.4.0 -r requirements.txt -r test-requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcre2 should be in the requirements.txt file
| pr_sha: ${{ steps.get_pr.outputs.pr_sha }} | ||
| steps: | ||
| - name: Download PR info | ||
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checkout is on v6 let's upgrade to the latest. Please double check all versions of actions in this PR.
| contents: read | ||
| actions: read | ||
| pull-requests: write | ||
| issues: write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is issues: write really needed?
Description:
Rationale: