-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add comprehensive dependency monitoring system #4025
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 1 commit
f33eea8
ebd0aaf
2344a76
af1fba5
78c25a5
2636885
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,211 @@ | ||||||||||||||||||||||
| name: Dependency Status Check | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||
| check_type: | ||||||||||||||||||||||
| description: "Type of dependency check" | ||||||||||||||||||||||
| required: false | ||||||||||||||||||||||
| default: "all" | ||||||||||||||||||||||
| type: choice | ||||||||||||||||||||||
| options: | ||||||||||||||||||||||
| - all | ||||||||||||||||||||||
| - node | ||||||||||||||||||||||
| - dotnet | ||||||||||||||||||||||
| - docker | ||||||||||||||||||||||
| - npm | ||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||
| - cron: "0 8 * * 1" # Weekly on Monday at 8 AM | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| dependency-status: | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| outputs: | ||||||||||||||||||||||
| node20-status: ${{ steps.check-versions.outputs.node20-status }} | ||||||||||||||||||||||
| node24-status: ${{ steps.check-versions.outputs.node24-status }} | ||||||||||||||||||||||
| dotnet-status: ${{ steps.check-versions.outputs.dotnet-status }} | ||||||||||||||||||||||
| docker-status: ${{ steps.check-versions.outputs.docker-status }} | ||||||||||||||||||||||
| buildx-status: ${{ steps.check-versions.outputs.buildx-status }} | ||||||||||||||||||||||
| npm-vulnerabilities: ${{ steps.check-versions.outputs.npm-vulnerabilities }} | ||||||||||||||||||||||
| open-dependency-prs: ${{ steps.check-prs.outputs.open-dependency-prs }} | ||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - uses: actions/checkout@v5 | ||||||||||||||||||||||
| - name: Setup Node.js | ||||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| node-version: "20" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Check dependency versions | ||||||||||||||||||||||
| id: check-versions | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| echo "## Dependency Status Report" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "Generated on: $(date)" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Check Node versions | ||||||||||||||||||||||
| if [[ "${{ github.event.inputs.check_type }}" == "all" || "${{ github.event.inputs.check_type }}" == "node" ]]; then | ||||||||||||||||||||||
| echo "### Node.js Versions" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| VERSIONS_JSON=$(curl -s https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json) | ||||||||||||||||||||||
| LATEST_NODE20=$(echo "$VERSIONS_JSON" | jq -r '.[] | select(.version | startswith("20.")) | .version' | head -1) | ||||||||||||||||||||||
| LATEST_NODE24=$(echo "$VERSIONS_JSON" | jq -r '.[] | select(.version | startswith("24.")) | .version' | head -1) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| CURRENT_NODE20=$(grep "NODE20_VERSION=" src/Misc/externals.sh | cut -d'"' -f2) | ||||||||||||||||||||||
| CURRENT_NODE24=$(grep "NODE24_VERSION=" src/Misc/externals.sh | cut -d'"' -f2) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| NODE20_STATUS="β up-to-date" | ||||||||||||||||||||||
| NODE24_STATUS="β up-to-date" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if [ "$CURRENT_NODE20" != "$LATEST_NODE20" ]; then | ||||||||||||||||||||||
| NODE20_STATUS="β οΈ outdated" | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if [ "$CURRENT_NODE24" != "$LATEST_NODE24" ]; then | ||||||||||||||||||||||
| NODE24_STATUS="β οΈ outdated" | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "| Version | Current | Latest | Status |" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "|---------|---------|--------|--------|" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "| Node 20 | $CURRENT_NODE20 | $LATEST_NODE20 | $NODE20_STATUS |" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "| Node 24 | $CURRENT_NODE24 | $LATEST_NODE24 | $NODE24_STATUS |" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "node20-status=$NODE20_STATUS" >> $GITHUB_OUTPUT | ||||||||||||||||||||||
| echo "node24-status=$NODE24_STATUS" >> $GITHUB_OUTPUT | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Check .NET version | ||||||||||||||||||||||
| if [[ "${{ github.event.inputs.check_type }}" == "all" || "${{ github.event.inputs.check_type }}" == "dotnet" ]]; then | ||||||||||||||||||||||
| echo "### .NET SDK Version" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| current_dotnet_version=$(jq -r .sdk.version ./src/global.json) | ||||||||||||||||||||||
| current_major_minor=$(echo "$current_dotnet_version" | cut -d '.' -f 1,2) | ||||||||||||||||||||||
| latest_dotnet_version=$(curl -sb -H "Accept: application/json" "https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$current_major_minor/latest.version") | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| DOTNET_STATUS="β up-to-date" | ||||||||||||||||||||||
| if [ "$current_dotnet_version" != "$latest_dotnet_version" ]; then | ||||||||||||||||||||||
| DOTNET_STATUS="β οΈ outdated" | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "| Component | Current | Latest | Status |" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "|-----------|---------|--------|--------|" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "| .NET SDK | $current_dotnet_version | $latest_dotnet_version | $DOTNET_STATUS |" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
| echo "" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "dotnet-status=$DOTNET_STATUS" >> $GITHUB_OUTPUT | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Check Docker versions | ||||||||||||||||||||||
| if [[ "${{ github.event.inputs.check_type }}" == "all" || "${{ github.event.inputs.check_type }}" == "docker" ]]; then | ||||||||||||||||||||||
| echo "### Docker Versions" >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| current_docker=$(grep "ARG DOCKER_VERSION=" ./images/Dockerfile | cut -d'=' -f2) | ||||||||||||||||||||||
| current_buildx=$(grep "ARG BUILDX_VERSION=" ./images/Dockerfile | cut -d'=' -f2) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| latest_docker=$(curl -s https://download.docker.com/linux/static/stable/x86_64/ | grep -o 'docker-[0-9]*\.[0-9]*\.[0-9]*\.tgz' | sort -V | tail -n 1 | sed 's/docker-\(.*\)\.tgz/\1/') | ||||||||||||||||||||||
|
||||||||||||||||||||||
| latest_docker=$(curl -s https://download.docker.com/linux/static/stable/x86_64/ | grep -o 'docker-[0-9]*\.[0-9]*\.[0-9]*\.tgz' | sort -V | tail -n 1 | sed 's/docker-\(.*\)\.tgz/\1/') | |
| latest_docker=$(curl -s https://api.github.com/repos/docker/docker-ce/releases/latest | jq -r '.tag_name' | sed 's/^v//;s/-ce$//') |
Copilot
AI
Sep 9, 2025
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 AUDIT_EXIT_CODE variable is set after the command completion, but $? may not reflect the correct exit code due to the assignment operation. Store the exit code immediately: npm audit --json 2>&1; AUDIT_EXIT_CODE=$?; AUDIT_OUTPUT=$(npm audit --json 2>&1) or use a different approach to capture both output and exit code reliably.
| # Run npm audit and capture output and exit code | |
| if ! AUDIT_OUTPUT=$(npm audit --json 2>&1); then | |
| AUDIT_EXIT_CODE=$? | |
| fi | |
| # Run npm audit and capture output and exit code reliably | |
| npm audit --json 2>&1 | tee audit_output.json > /dev/null | |
| AUDIT_EXIT_CODE=$? | |
| AUDIT_OUTPUT=$(cat audit_output.json) | |
| rm -f audit_output.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| # Runner Dependency Management Process | ||
|
|
||
| ## Overview | ||
|
|
||
| This document outlines the automated dependency management process for the GitHub Actions Runner, designed to ensure we maintain up-to-date and secure dependencies while providing predictable release cycles. | ||
|
|
||
| ## Release Schedule | ||
|
|
||
| - **Monthly Runner Releases**: New runner versions are released monthly | ||
| - **Weekly Dependency Checks**: Automated workflows check for dependency updates every Monday | ||
| - **Security Patches**: Critical security vulnerabilities are addressed immediately outside the regular schedule | ||
|
|
||
| ## Automated Workflows | ||
|
|
||
| ### 1. Node.js Version Updates | ||
| - **Workflow**: `.github/workflows/node-upgrade.yml` | ||
| - **Schedule**: Mondays at 6:00 AM UTC | ||
| - **Purpose**: Updates Node.js 20 and 24 versions in `src/Misc/externals.sh` | ||
| - **Source**: [actions/node-versions](https://github.com/actions/node-versions) | ||
|
||
|
|
||
| ### 2. NPM Security Audit | ||
| - **Workflow**: `.github/workflows/npm-upgrade.yml` | ||
| - **Schedule**: Mondays at 7:00 AM UTC | ||
| - **Purpose**: Runs `npm audit fix` on hashFiles dependencies | ||
| - **Location**: `src/Misc/expressionFunc/hashFiles/` | ||
|
|
||
| ### 3. .NET SDK Updates | ||
| - **Workflow**: `.github/workflows/dotnet-upgrade.yml` | ||
| - **Schedule**: Mondays at 12:00 AM UTC | ||
| - **Purpose**: Updates .NET SDK patch versions in `src/global.json` | ||
|
|
||
| ### 4. Docker/Buildx Updates | ||
| - **Workflow**: `.github/workflows/docker-buildx-upgrade.yml` | ||
| - **Schedule**: Mondays at 12:00 AM UTC | ||
| - **Purpose**: Updates Docker and Docker Buildx versions in `images/Dockerfile` | ||
|
|
||
| ### 5. Dependency Status Check | ||
| - **Workflow**: `.github/workflows/dependency-check.yml` | ||
| - **Schedule**: Mondays at 8:00 AM UTC | ||
| - **Purpose**: Provides comprehensive status report of all dependencies | ||
|
|
||
| ## Release Process Integration | ||
|
|
||
| ### Pre-Release Checklist | ||
|
|
||
| Before each monthly runner release: | ||
|
|
||
| 1. **Check Dependency PRs**: | ||
| ```bash | ||
| # List open dependency PRs | ||
| gh pr list --label "dependency" --state open | ||
| ``` | ||
|
|
||
| 2. **Run Manual Dependency Check**: | ||
| - Go to Actions tab β "Dependency Status Check" β "Run workflow" | ||
| - Review the summary for any outdated dependencies | ||
|
|
||
| 3. **Review and Merge Updates**: | ||
| - Prioritize security-related updates | ||
| - Test dependency updates in development environment | ||
| - Merge approved dependency PRs | ||
|
|
||
| ### Vulnerability Response | ||
|
|
||
| #### Critical Security Vulnerabilities | ||
| - **Response Time**: Within 24 hours | ||
| - **Process**: | ||
| 1. Assess impact on runner security | ||
| 2. Create hotfix branch if runner data security is affected | ||
| 3. Expedite patch release if necessary | ||
| 4. Document in security advisory if applicable | ||
|
|
||
| #### Non-Critical Vulnerabilities | ||
| - **Response Time**: Next monthly release | ||
| - **Process**: | ||
| 1. Evaluate if vulnerability affects runner functionality | ||
| 2. Include fix in regular dependency update cycle | ||
| 3. Document in release notes | ||
|
|
||
| ## Monitoring and Alerts | ||
|
|
||
| ### GitHub Actions Workflow Status | ||
| - All dependency workflows create PRs with the `dependency` label | ||
| - Failed workflows should be investigated immediately | ||
| - Weekly dependency status reports are generated automatically | ||
|
|
||
| ### Manual Checks | ||
| You can manually trigger dependency checks: | ||
| - **Full Status**: Run "Dependency Status Check" workflow | ||
| - **Specific Component**: Use the dropdown to check individual dependencies | ||
|
|
||
| ## Dependency Labels | ||
|
|
||
| All automated dependency PRs are tagged with the `dependency` label for easy filtering: | ||
| - Node.js updates: `chore/update-node` branch | ||
| - NPM security fixes: `chore/npm-audit-fix` branch | ||
| - .NET updates: `feature/dotnetsdk-upgrade/*` branch | ||
| - Docker updates: Branch named with versions | ||
|
|
||
| ## Special Considerations | ||
|
|
||
| ### Node.js Updates | ||
| When updating Node.js versions, remember to: | ||
| 1. Create a corresponding release in [actions/alpine_nodejs](https://github.com/actions/alpine_nodejs) | ||
| 2. Follow the alpine_nodejs getting started guide | ||
| 3. Test container builds with new Node versions | ||
|
|
||
| ### .NET SDK Updates | ||
| - Only patch versions are auto-updated within the same major.minor version | ||
| - Major/minor version updates require manual review and testing | ||
|
|
||
| ### Docker Updates | ||
| - Updates include both Docker Engine and Docker Buildx | ||
| - Verify compatibility with runner container workflows | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Common Issues | ||
|
|
||
| 1. **NPM Audit Workflow Fails**: | ||
| - Check if `package.json` exists in `src/Misc/expressionFunc/hashFiles/` | ||
| - Verify Node.js setup step succeeded | ||
|
|
||
| 2. **Version Detection Fails**: | ||
| - Check if upstream APIs are available | ||
| - Verify parsing logic for version extraction | ||
|
|
||
| 3. **PR Creation Fails**: | ||
| - Ensure `GITHUB_TOKEN` has sufficient permissions | ||
| - Check if branch already exists | ||
|
|
||
| ### Contact | ||
|
|
||
| For questions about the dependency management process: | ||
| - Create an issue with the `dependencies` label | ||
| - Review existing dependency management workflows | ||
| - Consult the runner team for security-related concerns | ||
|
|
||
| ## Metrics and KPIs | ||
|
|
||
| Track these metrics to measure dependency management effectiveness: | ||
| - Number of open dependency PRs at release time | ||
| - Time to merge dependency updates | ||
| - Number of security vulnerabilities by severity | ||
| - Release cycle adherence (monthly target) | ||
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 lacks accompanying tests to exercise the core functionality of the dependency checking logic. Consider adding tests in the
Test/L0directory to verify version comparison, vulnerability detection, and error handling scenarios.