Improve security update handling of newly reported issues and unavailable fix versions#48
Improve security update handling of newly reported issues and unavailable fix versions#48tekante wants to merge 1 commit into
Conversation
…able fix versions
WalkthroughThe PR adds a new optional ChangesUnpublished Package Version Handling
🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
actions/drupal-security-update/action.yml (1)
95-98:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse
--no-cachein the gating audit to avoid missing newly reported advisories.Line 97 currently allows cached advisory data. That can cause false negatives in the first audit and skip the entire update flow, which undermines this PR’s goal.
Suggested fix
- AUDIT_OUTPUT=$(composer audit --format=json --no-plugins 2>/dev/null) + AUDIT_OUTPUT=$(composer audit --no-cache --format=json --no-plugins 2>/dev/null)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@actions/drupal-security-update/action.yml` around lines 95 - 98, The composer audit call in the gating step uses cached advisory data and can miss newly reported advisories; update the command invoked where AUDIT_OUTPUT and AUDIT_EXIT_CODE are set so the composer audit invocation includes the --no-cache option (i.e., run composer audit --format=json --no-plugins --no-cache) to force fresh advisory data before capturing AUDIT_OUTPUT and AUDIT_EXIT_CODE.actions/drupal-security-update/README.md (1)
137-137:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate docs to reflect
--no-cacheaudit behavior.Line 137 is now out of sync with the updated workflow expectations. Please document
composer audit --no-cache --format=jsonhere as well.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@actions/drupal-security-update/README.md` at line 137, Update the documentation entry that describes the audit command to include the new --no-cache flag; specifically change the description that references "composer audit --format=json" to "composer audit --no-cache --format=json" so it matches the workflow expectation and ensures the README reflects the actual command used by the actions/drupal-security-update workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@actions/drupal-security-update/action.yml`:
- Around line 95-98: The composer audit call in the gating step uses cached
advisory data and can miss newly reported advisories; update the command invoked
where AUDIT_OUTPUT and AUDIT_EXIT_CODE are set so the composer audit invocation
includes the --no-cache option (i.e., run composer audit --format=json
--no-plugins --no-cache) to force fresh advisory data before capturing
AUDIT_OUTPUT and AUDIT_EXIT_CODE.
In `@actions/drupal-security-update/README.md`:
- Line 137: Update the documentation entry that describes the audit command to
include the new --no-cache flag; specifically change the description that
references "composer audit --format=json" to "composer audit --no-cache
--format=json" so it matches the workflow expectation and ensures the README
reflects the actual command used by the actions/drupal-security-update workflow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ac0a123a-4751-40a4-84dc-15f2e88749f9
📒 Files selected for processing (3)
actions/drupal-security-update/README.mdactions/drupal-security-update/action.ymlactions/drupal-security-update/instructions.md
| run: | | ||
| set +e | ||
| # --no-plugins prevents Composer plugins from writing to stdout and corrupting the JSON output | ||
| AUDIT_OUTPUT=$(composer audit --format=json --no-plugins 2>/dev/null) |
There was a problem hiding this comment.
@tekante Should we add --no-cache here as well?
AUDIT_OUTPUT=$(composer audit --no-cache --format=json --no-plugins 2>/dev/null)
| If the fixed version is not yet available in the package repository (i.e., `composer update` succeeds but the package version does not change, and the vulnerability persists in re-audit): | ||
|
|
||
| 1. Wait for the number of seconds specified as "Package wait seconds" in the workflow prompt, then retry the update once. | ||
| 2. If still unavailable, document in pr_body.md as "fixed version not yet published" with the advisory details and a note to re-run this workflow once the version is released. |
There was a problem hiding this comment.
I know emoji's are annoying to some, but I think it might be appropriate here. Something like
Use a attention-grabbing opening headline for the pr_body.md like, " ❌ IMPORTANT: fixed version not yet published. This workflow must be re-run to fix the security vulnerability."
Summary by CodeRabbit
Release Notes
New Features
package_wait_secondsparameter (default: 300 seconds) to configure retry behavior when fixed vulnerable package versions are unavailable.Improvements