Skip to content

fix: generate release commit URL in CITATION.cff - #88

Merged
beanbean9339 merged 4 commits into
mainfrom
fix/issue-87-release-commit-url
Nov 11, 2026
Merged

beanbean9339 merged 4 commits into
mainfrom
fix/issue-87-release-commit-url

Conversation

@beanbean9339

Copy link
Copy Markdown
Collaborator

Closes #87

Summary

The second identifiers entry in the generated CITATION.cff pointed to /tree/<release-tag> with a "source tree URL" description. It now links to the release commit instead.

What changed

  • Add a "Release commit hash" field to the form (releaseCommit in the metadata model).
  • CITATION.cff emits <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.
  • GitHub import resolves the latest release tag to its commit SHA (GET /repos/{owner}/{repo}/commits/{tag}) when the tag matches the version, ignoring a leading v. Otherwise the field stays empty for manual entry.
  • README updated.

Testing

  • New tests for commit URL output, missing or invalid hash handling, and importer tag-to-SHA resolution.
  • citationValidation tests pass. The githubImporter tests pass with a Response.json shim; the local Node 16 environment lacks it. I couldn't run npm run build locally 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.

@beanbean9339 beanbean9339 added the bug Something isn't working label Nov 8, 2026
@beanbean9339
beanbean9339 requested a balanced review from Copilot November 8, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

Comment thread src/services/citation.js Resolved
Comment thread src/services/githubImporter.js Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the release-commit citation changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@egrace479

Copy link
Copy Markdown
Member

Spacing got wonky loading in the Collab Guide, but it pulled everything in correctly there (also weird formatting for OpenCite):
Screenshot 2026-11-09 at 12 04 39 PM

Loading in OpenCite, I edited the tag to v1.1.0 and that updated, but not the version. We should have a warning when those mis-match. Also, since we have a tag-edit field which also mentions the "leading v", let's default the tag to v + version-number and then we can have the commit URL (as in the template) with the # Update on release comment following it (good to include by default).

@beanbean9339

Copy link
Copy Markdown
Collaborator Author

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 egrace479 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@beanbean9339
beanbean9339 merged commit 2044a1e into main Nov 11, 2026
1 check passed
@beanbean9339
beanbean9339 deleted the fix/issue-87-release-commit-url branch November 11, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate a release commit URL in CITATION.cff

3 participants