Repository navigation
fix: generate release commit URL in CITATION.cff - #88
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The resolved release tag is not preserved separately from the metadata version, causing incorrect tag descriptions, and tests omit leading-v equivalence and mismatched-release safeguards.
2 open issues
What changed in this PR
This PR updates OpenCite’s citation export to link to a release commit instead of the tag’s source tree, addressing the OpenCite portion of #87. The Imageomics guide update remains a separate follow-up.
Changes:
- Add a release commit hash field throughout the form and metadata pipeline.
- Resolve matching GitHub release tags to commit hashes and emit commit identifiers when valid.
- Add regression tests and document the release workflow.
| File | Description |
|---|---|
tests/services/githubImporter.test.js |
Tests release-tag-to-commit resolution. |
tests/services/citationValidation.test.js |
Tests commit identifiers and missing or invalid hashes. |
src/validation/validation.js |
Trims the release commit input. |
src/services/githubImporter.js |
Resolves matching release tags to commit hashes. |
src/services/githubApi.js |
Adds a commit lookup URL builder. |
src/services/citation.js |
Replaces source-tree identifiers with commit URLs. |
src/metadata/normalizeMetadata.js |
Preserves the commit hash during normalization. |
src/core/metadataModel.js |
Defines the release commit metadata field. |
src/components/MetadataForm.jsx |
Adds the commit hash input and guidance. |
src/App.jsx |
Carries the commit hash into form state. |
README.md |
Documents commit identifiers and hash updates. |
Review effort: Balanced
|
Spacing got wonky loading in the Collab Guide, but it pulled everything in correctly there (also weird formatting for OpenCite): Loading in OpenCite, I edited the tag to |
|
I reorganized the Publishing metadata section to make it easier to follow and clarify the difference between the version in the citation and the GitHub release tag. The version is what gets written to CITATION.cff; the release tag is the exact GitHub tag used to create the release link, and may differ (for example, by including a leading v). I also clarified the mismatch warning and tightened the field spacing and helper text. |
egrace479
left a comment
There was a problem hiding this comment.
Looks good! I think we still want the placeholder URL when there isn't a release, but that would be outside the scope of this PR.


Closes #87
Summary
The second
identifiersentry in the generatedCITATION.cffpointed to/tree/<release-tag>with a "source tree URL" description. It now links to the release commit instead.What changed
releaseCommitin the metadata model).CITATION.cffemits<repo-url>/commit/<commit-hash>with the description "The GitHub URL of the commit tagged with ." when a valid hash (7-40 hex characters) is present. Without a valid hash, only the release URL is emitted and the/tree/identifier is dropped.GET /repos/{owner}/{repo}/commits/{tag}) when the tag matches the version, ignoring a leadingv. Otherwise the field stays empty for manual entry.Testing
citationValidationtests pass. ThegithubImportertests pass with aResponse.jsonshim; the local Node 16 environment lacks it. I couldn't runnpm run buildlocally for the same Node 16 reason.Follow-up
The Imageomics guide template currently uses
/tree/<commit-hash>. It should be updated in the guide repository to match this/commit/format and description.