ci(gitlab): Improve GitLab reliability#12415
Conversation
👋 Hello lucasssvaz, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results101 files 101 suites 27m 39s ⏱️ Results for commit e9f6363. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR hardens and improves reliability of the cross-system CI setup (GitHub Actions → GitLab) used for hardware and Wokwi testing by sourcing trusted PR metadata, strengthening network operations, and adjusting runner/job selection behavior.
Changes:
- GitHub Actions: derive PR/base/labels via GitHub API and standardize passing values via
envto reduce injection risk. - GitLab CI: update checkout and artifact download logic (HTTP/1.1 settings, retries/timeouts) to be more resilient.
- GitLab job generation: conditionally include
eco_defaulttag only when matching runners exist.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/tests_hw_wokwi.yml |
Fetches trusted PR metadata via GitHub API; normalizes env handling; clarifies secure checkout behavior. |
.gitlab/scripts/get_artifacts.sh |
Adds curl retries/timeouts and forces HTTP/1.1 for more robust artifact fetching. |
.gitlab/scripts/gen_hw_jobs.py |
Adjusts tag selection to add eco_default only when runners can satisfy it. |
.gitlab/workflows/hardware_tests_dynamic.yml |
Changes repo checkout flow to fetch/checkout with HTTP settings. |
.gitlab/workflows/hw_test_template.yml |
Changes per-hardware-job checkout flow to fetch/checkout with HTTP settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6dc60a0 to
e9f6363
Compare
Description of Change
This pull request improves the security, reliability, and maintainability of the GitHub Actions and GitLab CI workflows for hardware and Wokwi tests. The main changes focus on securely deriving workflow variables, using trusted sources for PR metadata, enhancing artifact download robustness, and updating repository checkout strategies to prevent security risks. The changes also improve environment variable handling and make the workflows more resistant to script injection and network issues.
Security and Trusted Data Handling:
.github/workflows/tests_hw_wokwi.yml) to fetch PR metadata (number, base branch, labels) directly from the GitHub API, ensuring only trusted sources are used for security-critical values and preventing potential injection attacks from fork PRs or crafted artifacts. [1] [2]Workflow Variable and Environment Improvements:
envto ensure consistency and prevent accidental script injection. [1] [2] [3] [4] [5]Artifact Download Robustness:
.gitlab/scripts/get_artifacts.sh) to usecurlwith retries, connection timeouts, and HTTP/1.1 for better reliability under network issues. [1] [2]Repository Checkout Strategy:
.gitlab/workflows/hardware_tests_dynamic.yml,.gitlab/workflows/hw_test_template.yml) to usegit fetchandgit checkoutwith HTTP/1.1 and custom low-speed settings, replacinggit clone, to improve reliability and prevent incomplete checkouts. [1] [2]Job Tagging Logic:
.gitlab/scripts/gen_hw_jobs.py) to conditionally include theeco_defaulttag only if matching runners are available, improving job scheduling flexibility.Test Scenarios
Tested in fork