Conversation
|
Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again! |
Reviewer's GuideAligns DOI handling and citation.cff generation with citation schema 1.3.0 by extracting clean DOI values from various identifier formats and using them consistently in both the API code-metadata handler and the metadata compliance bot. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions! |
PR Summary
|
|
Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help! |
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The DOI extraction logic and
DOI_REGEXare duplicated in both the API handler and the compliance-checks script; consider extracting a shared utility to keep the behavior and pattern consistent and easier to maintain. - In
code-metadata/index.post.ts, the comment above the (disabled)identifiersblock now mixes a JSDoc opening/**with a line comment// Note: ...; converting this to a single coherent block comment or a plain line comment would improve readability. - In
updateMetadataIdentifier, whenidentifierStringis emptycitationFile.doiis set to an empty string; if the intention is to omit the DOI in that case, consider leavingcitationFile.doiundefined instead of assigning an empty value.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The DOI extraction logic and `DOI_REGEX` are duplicated in both the API handler and the compliance-checks script; consider extracting a shared utility to keep the behavior and pattern consistent and easier to maintain.
- In `code-metadata/index.post.ts`, the comment above the (disabled) `identifiers` block now mixes a JSDoc opening `/**` with a line comment `// Note: ...`; converting this to a single coherent block comment or a plain line comment would improve readability.
- In `updateMetadataIdentifier`, when `identifierString` is empty `citationFile.doi` is set to an empty string; if the intention is to omit the DOI in that case, consider leaving `citationFile.doi` undefined instead of assigning an empty value.
## Individual Comments
### Comment 1
<location> `bot/compliance-checks/metadata/index.js:678-680` </location>
<code_context>
+ }
}
- citationFile.doi = doiUrl;
+ citationFile.doi = doiValue;
citationFile["date-released"] = updated_date;
citationFile.version = zenodoMetadata?.zenodo_metadata?.version;
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Avoid assigning an empty string to `citationFile.doi` when no identifier is provided.
With the current logic, a falsy `identifier` leaves `doiValue` as `""`, so `citationFile.doi` is explicitly set to an empty string. Instead, consider only setting the field when `doiValue` is truthy, e.g.:
```js
if (doiValue) {
citationFile.doi = doiValue;
}
```
This prevents persisting an empty DOI and keeps the field’s presence meaningful.
```suggestion
}
if (doiValue) {
citationFile.doi = doiValue;
}
citationFile["date-released"] = updated_date;
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Align citation generation and metadata handling with the updated citation schema by normalizing DOI values and avoiding redundant DOI URL storage.
New Features:
Bug Fixes:
Enhancements: