-
Notifications
You must be signed in to change notification settings - Fork 6
feat: update .gitignore and add flaky.yml workflow #75
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||
| - develop | ||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||
| - develop | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Add a descriptive workflow name. The workflow is missing a top-level 🔎 Proposed addition+name: Flaky Test Detection and Reporting
+
on:
push:As per coding guidelines, always start with a descriptive 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Add a descriptive job name. The job is missing a 🔎 Proposed addition jobs:
test:
+ name: Run Tests and Upload Results
runs-on: ubuntu-latest
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| steps: | |
| steps: | |
| - name: Check out 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.
issue (bug_risk): Consider adding an explicit checkout step before running tests and uploading results.
This job runs on ubuntu-latest without checking out the repo, so it won’t see your test code or JUnit XML files. Add a - uses: actions/checkout@v4 step before Run Tests so the workflow has access to the repository contents.
Copilot
AI
Jan 7, 2026
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.
The 'run' command contains placeholder text '...' which will cause the workflow to fail. This needs to be replaced with the actual test command (e.g., 'npm test', 'pytest', or whatever test runner is used in this repository).
| run: ... | |
| run: echo "No tests are configured for this workflow yet." |
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.
🚨 suggestion (security): Pin the analytics-uploader action to a specific version or commit for supply-chain safety.
Using @main will automatically pull in any future changes to trunk-io/analytics-uploader, including potentially breaking or malicious ones. Please pin this to a tagged release (e.g. @vX) or, ideally, a specific commit SHA to keep the workflow deterministic and auditable.
Suggested implementation:
- name: Upload Test Results to Trunk.io
if: ${{ !cancelled() }} # Upload the results even if the tests fail
continue-on-error: true # don't fail this job if the upload fails
# Pin to a specific version or commit for supply-chain safety.
# Replace `vX.Y.Z` with the desired tagged release or a specific commit SHA.
uses: trunk-io/analytics-uploader@vX.Y.Z
with:
junit-paths: "**/*.xml"
org-slug: deanmachines
token: ${{ secrets.TRUNK_API_TOKEN }}
- Decide on the exact ref to pin to:
- Prefer a tagged release, e.g.
trunk-io/analytics-uploader@v1,@v1.2.3. - For maximum determinism, use a full commit SHA, e.g.
@0123456789abcdef0123456789abcdef01234567.
- Prefer a tagged release, e.g.
- Update
vX.Y.Zin theuses:line to that chosen tag or SHA. - Optionally, document the chosen version/commit in a comment (e.g., link to the release or commit on GitHub) to aid future audits and upgrades.
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.
suggestion (bug_risk): Narrow the JUnit glob pattern to avoid picking up unrelated XML files.
**/*.xml will include non-test XML files (configs, reports from other tools, etc.), which can lead to noisy or misclassified results in Trunk. If you know the directory structure, consider a more specific glob (e.g. reports/**/junit-*.xml or **/test-results/**/*.xml) to target only JUnit outputs.
Suggested implementation:
- name: Upload Test Results to Trunk.io
if: ${{ !cancelled() }} # Upload the results even if the tests fail
continue-on-error: true # don't fail this job if the upload fails
uses: trunk-io/analytics-uploader@main
with:
# Restrict to typical test result locations to avoid unrelated XML files
junit-paths: |
**/test-results/**/*.xml
**/junit/**/*.xml
org-slug: deanmachines
token: ${{ secrets.TRUNK_API_TOKEN }}
If your project uses a different directory layout for JUnit outputs (e.g. reports/junit/*.xml, build/test-results/test/*.xml, or target/surefire-reports/*.xml), update the junit-paths entries accordingly to match those actual paths. The key is to:
- Point only at directories where JUnit reports are written.
- Avoid root-level or generic
**/*.xmlpatterns that include config or tool output XML.
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.
Security and reliability concerns with the upload step.
This step has multiple issues already flagged by previous reviewers:
- Security risk: Using
@mainfor the action reference means any changes pushed to the main branch will automatically be pulled into your workflow, including potentially malicious code - Overly broad pattern: The
**/*.xmlpattern will match any XML file in the repository, not just JUnit test results, potentially uploading configuration files or other unrelated XML
Additionally, without the checkout step (see previous comment), this step will find no files to upload.
🔎 Recommended fixes
1. Pin the action to a specific version:
- uses: trunk-io/analytics-uploader@main
+ uses: trunk-io/analytics-uploader@v1 # or a specific commit SHA2. Narrow the JUnit paths pattern:
with:
- junit-paths: "**/*.xml"
+ junit-paths: |
+ **/test-results/**/*.xml
+ **/junit/**/*.xml
org-slug: deanmachinesAdjust the paths to match your actual test output directories.
As per coding guidelines, always specify a secure version (tag or SHA) for actions and use specific paths for file patterns.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Upload Test Results to Trunk.io | |
| if: ${{ !cancelled() }} # Upload the results even if the tests fail | |
| continue-on-error: true # don't fail this job if the upload fails | |
| uses: trunk-io/analytics-uploader@main | |
| with: | |
| junit-paths: "**/*.xml" | |
| org-slug: deanmachines | |
| token: ${{ secrets.TRUNK_API_TOKEN }} | |
| - name: Upload Test Results to Trunk.io | |
| if: ${{ !cancelled() }} # Upload the results even if the tests fail | |
| continue-on-error: true # don't fail this job if the upload fails | |
| uses: trunk-io/analytics-uploader@v1 # or a specific commit SHA | |
| with: | |
| junit-paths: | | |
| **/test-results/**/*.xml | |
| **/junit/**/*.xml | |
| org-slug: deanmachines | |
| token: ${{ secrets.TRUNK_API_TOKEN }} |
🤖 Prompt for AI Agents
In @.github/workflows/flaky.yml around lines 22 - 29, The "Upload Test Results
to Trunk.io" workflow step is insecure and too broad: replace the uses reference
trunk-io/analytics-uploader@main with a pinned tag or commit SHA (do not use
@main), narrow the junit-paths pattern to the actual test output directory(s)
instead of "**/*.xml" (e.g., your CI test-report folder), and ensure a prior
checkout action (actions/checkout@vX or pinned SHA) runs so the uploader can
find files; update the step name or inputs accordingly to reflect these changes.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -127,7 +127,7 @@ opnapi.json | |||||||||||||
| openapi.json | ||||||||||||||
|
|
||||||||||||||
| # GitHub Actions | ||||||||||||||
| .github/workflows/**.yml | ||||||||||||||
|
|
||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
| .github/workflows/**.yaml | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Extension mismatch between ignore pattern and workflow file. The ignore pattern targets
Consider one of these solutions:
🔎 Recommended fix to ignore both extensions-.github/workflows/**.yaml
+.github/workflows/**/*.{yml,yaml}📝 Committable suggestion
Suggested change
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| .github/actions/**/node_modules/ | ||||||||||||||
| .github/actions/**/dist/ | ||||||||||||||
|
|
||||||||||||||
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.
The workflow is missing a 'name' field at the top level. Adding a descriptive name like 'name: Flaky Test Detection' would make the workflow easier to identify in the GitHub Actions UI.