Skip to content

Conversation

@benedictfischer09
Copy link

Based on the issues reported in #6098 some of the attestation data was stored incorrectly in the database. This rake task is able to fix two issues 1) missing kindVersion field 2) double encoded verificationMaterial.certificate.rawBytes

Before

curl http://localhost:3000/api/v1/attestations/faraday-2.14.0 | jq | grep -A 3 kindVersion
no matches

cosign verify-blob --bundle faraday-2.14.0.sigstore.json --certificate-identity-regexp "https://github.com/lostisland/faraday/.github/workflows/publish.yml@refs/tags/v2.14.0" --certificate-oidc-issuer "https://token.actions.githubusercontent.com" faraday-2.14.0.gem
Error: bundle does not contain cert for verification, please provide public key
error during command execution: bundle does not contain cert for verification, please provide public key

After bundle exec rake attestations:repair

curl http://localhost:3000/api/v1/attestations/faraday-2.14.0 | jq | grep -A 3 kindVersion
"kindVersion": {
"kind": "dsse",
"version": "0.0.1"
},

cosign verify-blob --bundle faraday-2.14.0-fixed.sigstore.json --certificate-identity-regexp "https://github.com/lostisland/faraday/.github/workflows/publish.yml@refs/tags/v2.14.0" --certificate-oidc-issuer "https://token.actions.githubusercontent.com" faraday-2.14.0.gem
Verified OK

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.46%. Comparing base (164a40e) to head (46394d9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6141      +/-   ##
==========================================
- Coverage   97.24%   94.46%   -2.78%     
==========================================
  Files         476      476              
  Lines        9785     9844      +59     
==========================================
- Hits         9515     9299     -216     
- Misses        270      545     +275     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@jenshenny jenshenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. I would prefer it to be a maintenance task eg. something like app/tasks/maintenance/user_totp_seed_empty_to_nil_task.rb with a dry run dropdown option. There's only ~4000 attestation records in the db + if this will be deleted after it's run then a rake task is ok.

I'd be curious to see the dry run results before any records are changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants