aRustyDev / aRustyDev/helm-charts

bug: attestation map race condition in W1 parallel jobs

Open
#47 0 comments 0 reactions 1 assignee Claimed by @aRustyDev View on GitHub
bug
Dominant language
Go Template
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

When multiple W1 jobs run in parallel (lint-test matrix, artifacthub-lint, changelog, commit-validation), they all try to update the attestation map in the PR description simultaneously. This causes race conditions where later updates overwrite earlier ones, resulting in incomplete attestation maps.

## Current Behavior

Only 1-2 attestations are stored in the map despite 6+ jobs generating attestations.

Example from PR #46:
```

```

Expected: All attestations from lint-test (x3), artifacthub-lint, commit-validation, changelog.

## Impact

- **W2-W4**: Low impact - these workflows can work with partial attestation data
- **W5, W7**: High impact - these workflows verify the complete attestation chain

## Proposed Solutions

1. **File-based locking**: Use `flock` to serialize updates (complex in parallel jobs)
2. **Sequential attestation job**: Single job at end that collects all attestation IDs from artifacts
3. **GitHub API with ETag**: Use optimistic concurrency control
4. **Matrix output aggregation**: Use `needs` and matrix outputs to collect all IDs first

## Acceptance Criteria

- [ ] All attestations from W1 jobs are stored in the PR description
- [ ] No attestations are lost due to race conditions
- [ ] Solution works with parallel job execution

## References

- W1 Workflow: `.github/workflows/validate-contribution.yaml`
- Attestation library: `.github/scripts/attestation-lib.sh`
- Plan: `.claude/plans/chart-release-workflows/workflow-1/plan.md` (Phase 1.7)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.