Repository navigation
OpenConceptLab/ocl_issues#3055 | Fix/fill custom algo form - #131
filiperochalopes wants to merge 6 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3198b26e7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
snyaggarwal
left a comment
There was a problem hiding this comment.
Reviewed at 3198b26. I ran the new test file locally and all 7 tests pass.
Filling the canonical URL from metadata and sharing the validator both look good. Two things I'd change before merging, plus one question (details inline):
- Probe order. The stripped
/matchpath is now requested before the configured$matchURL. Endpoints that work today now take two requests, and they can pick up the wrong document. Trying the configured URL first, with the stripped path as the fallback, avoids both. - Duplicate ID/name check. I agree with the Codex comment. Adding
canonical_urlto the patch weakens the conflict check inupdateSelected. A fix is suggested inline. - Question: should metadata overwrite a canonical URL the user typed by hand?
The PR's browser check is still unticked. It's worth running against a server that serves metadata only on $match, to confirm the extra 404 on /match doesn't show up anywhere in the form.
|
There's no ticket for this change. The PR body says no tracking issue is linked, and the commits don't reference one. Please file a ticket in OpenConceptLab/ocl_issues first, describing the problem (custom algorithm form not filling the canonical URL from metadata, and servers that serve discovery on the path without |
…he configured URL first, then the path without the operation marker, then the parent path
…s the canonical URL only when empty; document why the validator exists
|
Review round addressed at b709f42, tracked in OpenConceptLab/ocl_issues#3055.
Checks: Still pending: the browser checks in the PR description (ICD Agent form; a genuinely duplicated ID/name; a server that serves metadata only on |
snyaggarwal
left a comment
There was a problem hiding this comment.
Approving at b709f42. Everything from my Nov 17 review is in, and thanks for filing OpenConceptLab/ocl_issues#3055:
- Probe order:
fetchAlgorithmMetadataasks the configured URL first, then/match, then the parent path, and stops at the first usable metadata. An endpoint that works today stays at one request and never reaches another document, and a 401/403 still wins over a later 404. TheConceptMap/$translatetest pins it. - Duplicate ID/name:
conflictingFieldschecksidandnameseparately, against the other rows only (by__key). A row no longer conflicts with itself, andcanonical_urlordescriptionin the patch can't hide a duplicate. The form reads the flags as booleans, sotrue/falseboth work. - A hand-entered canonical URL is kept:
metadataFieldsfills it only when the field is empty. - The validator's comment now says why it exists.
Two small things before merging:
- The title is still "Fix/fill custom algo form". A squash merge takes the title, so please prefix it with
OpenConceptLab/ocl_issues#3055 |, as asked on Nov 17. - The description is behind the code. Its "Discovery order" table still lists
/matchfirst, and the opening line still says no tracking issue is linked.
The browser checks you list (the ICD Agent form, a real duplicate, a server with metadata only on $match) are still worth a run, since no component test covers the MultiAlgoSelector wiring. CI is green, and it merges cleanly with main.
Is it really needed to merge? We need to have a shared repo of skills to sync these minor rules @snyaggarwal @paynejd, @snyaggarwal I'd think you are the most capable one (editing code) to write the know arch skills and guardrails https://github.com/OpenConceptLab/skills? |
Done |
TL;DR: The custom algorithm form now fills
canonical_urlfrom the algorithm's discovery GET, finds that metadata on up to three URLs, and no longer flags an algorithm as conflicting with itself. Tracked in OpenConceptLab/ocl_issues#3055.Closes OpenConceptLab/ocl_issues#3055
Main Changes
src/components/map-projects/MultiAlgoSelector.jsx(+9/−17)canonical_url) to the form; verify the endpoint through the metadata fallback; useconflictingFieldsfor ID/name conflicts; drop the unusedfilterimport.src/components/map-projects/customAlgoMetadata.js(+48/−0)metadataFields(validcanonical_urlonly),fetchAlgorithmMetadata(three-step GET discovery) andconflictingFields(ID/name conflicts against other algorithms).src/components/map-projects/algorithms.jsx(+2/−7)isLikelyCanonicalUrlfrom the new module, so existing imports keep working.src/components/map-projects/__tests__/customAlgoMetadata.test.js(+148/−0)Net diff against
origin/main: 4 files, +207/−24. Commits:2370122,3198b26,c800ed0,74f1b88,520e12e,b709f42.Discovery order
The configured URL is the one the Mapper POSTs
$matchto; discovery only changes which URLs are read with GET. Example forhttps://host/api/ciel-bridge-rxnorm/$match:https://host/api/ciel-bridge-rxnorm/$matchnameandID/idhttps://host/api/ciel-bridge-rxnorm/matchhttps://host/api/ciel-bridge-rxnormA URL without
$is requested once. Query strings and fragments are preserved; the operation-path candidates retain a trailing slash. If every step fails, a 401/403 from any step is the reported error (token-required feedback); otherwise the last response is.Key Decisions
canonical_urlfrom the GET when it is a valid http(s) URL.$, then parent path.GET /api/<name>next toPOST /api/<name>/$match)..jsmodule instead ofalgorithms.jsx.algorithms.jsximports React/MUI and cannot be loaded bynode --test.Verification Checklist
npm test: 683 passed, 0 failed (reported in the review follow-up atb709f42; baseline before this branch: 667).npm run test:integration: 11 passed.npm run eslint: no findings.$matchin the browser. No automated component test covers theMultiAlgoSelector.jsxwiring.