Repository navigation
Memory tester adjustments #315
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
Open
alan-george-lk
wants to merge
4
commits into
main
Choose a base branch
from
alan/feature-memory-limits
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3b71543
Adjust memory thresholds, update PR comment with results
alan-george-lk f29e75e
Merge branch 'main' into alan/feature-memory-limits
alan-george-lk 0efebc7
Capture bundle test changes, memory commenter adjustments
alan-george-lk ab8938f
Merge branch 'main' into alan/feature-memory-limits
alan-george-lk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # Copyright 2026 LiveKit, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Memory results comment | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: [CI] | ||
| types: [completed] | ||
|
|
||
| # Keep write access out of the build jobs, including builds of fork PRs. | ||
| # This workflow never checks out or executes code from the triggering run. | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| concurrency: | ||
| group: memory-results-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| comment: | ||
| if: github.event.workflow_run.event == 'pull_request' | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Find memory report | ||
| id: report | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | ||
| with: | ||
| script: | | ||
| const run = context.payload.workflow_run; | ||
| const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, { | ||
| ...context.repo, run_id: run.id | ||
| }); | ||
| const artifact = artifacts.find(item => | ||
| item.name === `memory-tester-report-${run.run_attempt}` && !item.expired); | ||
| if (artifact) core.setOutput('artifact-id', artifact.id); | ||
|
|
||
| - name: Download memory report | ||
| if: steps.report.outputs.artifact-id != '' | ||
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | ||
| with: | ||
| artifact-ids: ${{ steps.report.outputs.artifact-id }} | ||
| merge-multiple: true | ||
| path: ${{ runner.temp }}/memory-results | ||
| github-token: ${{ github.token }} | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
|
|
||
| - name: Update PR comment | ||
| if: steps.report.outputs.artifact-id != '' | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | ||
| with: | ||
| script: | | ||
| const fs = require('node:fs'); | ||
| const run = context.payload.workflow_run; | ||
| // Resolve the PR through GitHub, never through downloaded metadata. | ||
| // The workflow_run pull_requests array can be empty for fork PRs. | ||
| const pulls = await github.paginate(github.rest.repos.listPullRequestsAssociatedWithCommit, { | ||
| ...context.repo, commit_sha: run.head_sha | ||
| }); | ||
| const marker = '<!-- livekit-memory-results -->'; | ||
| const report = fs.readFileSync(`${process.env.RUNNER_TEMP}/memory-results/memory-tester-report.md`, 'utf8'); | ||
| if (report.length > 32000) throw new Error('Memory report is too large'); | ||
| const needsAttention = /:x: (FAIL|ERROR)|:warning: ADVISORY/.test(report); | ||
| for (const pull of pulls) { | ||
| const { data: current } = await github.rest.pulls.get({ | ||
| ...context.repo, pull_number: pull.number | ||
| }); | ||
| if (current.state !== 'open' || current.head.sha !== run.head_sha || | ||
| current.base.repo.full_name !== `${context.repo.owner}/${context.repo.repo}`) continue; | ||
| const comments = await github.paginate(github.rest.issues.listComments, { | ||
| ...context.repo, issue_number: pull.number | ||
| }); | ||
| const existing = comments.find(comment => | ||
| comment.user.login === 'github-actions[bot]' && comment.body?.startsWith(marker)); | ||
| // A delayed completion or rerun must not replace a newer result. | ||
| const previous = existing?.body.match(/<!-- run:(\d+) attempt:(\d+) -->/); | ||
| if (previous && (Number(previous[1]) > run.id || | ||
| (Number(previous[1]) === run.id && Number(previous[2]) > run.run_attempt))) continue; | ||
| const body = `${marker}\n<!-- run:${run.id} attempt:${run.run_attempt} -->\n` + | ||
| `${needsAttention ? '⚠️ Memory checks need attention.' : '✅ Memory checks passed.'}\n\n` + | ||
| `[CI run](${run.html_url}/attempts/${run.run_attempt}) · Commit ${run.head_sha}\n\n${report}`; | ||
| if (existing) { | ||
| await github.rest.issues.updateComment({ ...context.repo, comment_id: existing.id, body }); | ||
| } else { | ||
| await github.rest.issues.createComment({ ...context.repo, issue_number: pull.number, body }); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🟡 Nightly tests blocked by renamed input
Scheduled and manual nightly runs fail validation because
extended_capture_sourcesno longer exists. The nightly caller still passes it instead ofrun_capture_bundle_tests, preventing all nightly tests from starting.Learn more
Reusable workflow callers can only pass inputs declared by the called workflow. The nightly caller still passes
extended_capture_sources: true, but the declared input is nowrun_capture_bundle_tests. GitHub rejects this caller before its test jobs start.Example: The daily scheduled nightly run invokes the test workflow with
extended_capture_sources: true. Validation rejects that undeclared input instead of starting the test matrix.Recommended fix: Rename the nightly caller's argument to
run_capture_bundle_tests: true. Keep its value enabled so both scheduled and manual nightly runs execute the selective and all-sources bundle checks.Was this helpful? React with 👍 or 👎 to provide feedback.