Repository navigation
fix: dedupe llm repo resolution jobs on the lowercased purl type - #5010
Conversation
Refs linuxfoundation/lfx-cdp-insights-ops#502 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
…ob poll Refs linuxfoundation/lfx-cdp-insights-ops#502 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
PR SummaryLow Risk Overview The Akrites OpenAPI schema for member-contributors poll Reviewed by Cursor Bugbot for commit 04962fb. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
|
There was a problem hiding this comment.
🟡 Changes recommended
Existing mixed-case job keys remain unmatched after deployment, allowing duplicate paid workflows.
1 open finding
What changed in this PR
This PR normalizes purl types when submitting inferred-repository contributor jobs, aiming to prevent duplicate paid LLM calls.
Changes:
- Canonicalizes inferred-job purls before lookup and creation.
- Adds normalization tests and lookup assertions.
- Documents the expired-result response in OpenAPI.
| File | Description |
|---|---|
| backend/src/api/public/v1/packages/submitMemberContributorsJob.ts | Normalizes inferred-job keys. |
| backend/src/api/public/v1/packages/submitMemberContributorsJob.test.ts | Verifies canonical lookup and creation keys. |
| backend/src/api/public/v1/packages/memberContributorCollectionPaths.ts | Adds type-only purl normalization. |
| backend/src/api/public/v1/packages/memberContributorCollectionPaths.test.ts | Tests normalization while preserving package-name case. |
| backend/src/api/public/v1/akrites-external/openapi.yaml | Documents expired inferred-job results. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (!isWellFormedPurl(requestedPurl)) { | ||
| throw new BadRequestError('Malformed purl') | ||
| } | ||
| const purl = canonicalizePurlType(requestedPurl) |
There was a problem hiding this comment.
Not reachable with the data that exists. The table holds 4 jobs in prod (2 github, 2 llm_repo_resolution, created today) and none has a mixed-case purl type, so no stored key is orphaned by this change. Had one existed the cost would be a single extra LLM call (~$0.002) after which the lowercased row becomes the one every later lookup hits; a migration for that is not worth the risk. Leaving as is.

Summary
pkg:Hackage/aesonandpkg:hackage/aesonnow share one LLM repo resolution job and the second submission gets the 409 instead of a second paid LLM call. Follow-up to feat: resolve member contributors for unknown ecosystems via llm repo inference #5000 (Bugbot finding that landed after the squash merge).failedschema now describes theJob result expired, resubmit the jobreason inferred-repo jobs return once their result has left Temporal retention, so Akrites can match on it.Refs linuxfoundation/lfx-cdp-insights-ops#502