Skip to content

introduced change that fixes issue #91 - #128

Open
jjijon7000 wants to merge 3 commits into
devfrom
issue-91-populate-version
Open

introduced change that fixes issue #91#128
jjijon7000 wants to merge 3 commits into
devfrom
issue-91-populate-version

Conversation

@jjijon7000

@jjijon7000 jjijon7000 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR automates populating the version field in code.json from the latest GitHub release while preserving the existing merge pattern in src/main.ts.

What changed

  • Removed existingCodeJSON from calculateMetaData() in src/helper.ts.
  • Kept release lookup logic in the helper, but now it only returns the latest release version string.
  • Moved the version fallback/merge logic into src/main.ts, following the same pattern already used for feedbackMechanism and SBOM.
  • Updated unit tests in:
    • src/__tests__/unit/helper.test.ts
    • src/__tests__/unit/main.test.ts

Notes

  • The implementation still uses the GitHub API release endpoint because repos.get() does not include latest release data.
  • If a release version cannot be fetched, main.ts preserves the existing version from code.json.

Validation

  • npx jest src/__tests__/unit/helper.test.ts src/__tests__/unit/main.test.ts

AI Usage

  • Generated AI was used in this contribution

If checked, please provide an explanation on how AI was used in the development of this pull request:

  • Description: Used ChatGPT (Codex) to refactor the PR to align with the existing project design patterns based on reviewer feedback.

  • Type of assistance:

  • Code generation

  • Documentation

  • Debugging

  • Testing

  • Refactoring

  • Other:

  • Scope of usage: src/main.ts, src/helper.ts, src/__tests__/unit/helper.test.ts, src/__tests__/unit/main.test.ts

  • AI System used:

  • ChatGPT

  • Claude

  • Gemini

  • GitHub Copilot

  • Level of modification: - [ ] As-is - [x] Modified - [ ] Used as inspiration

  • Prompts used: "Please refactor my code to address reviewer feedback on my PR... revert the function signature in helper.ts, move the merging logic to main.ts, and update the corresponding unit tests."

@jjijon7000 jjijon7000 added the enhancement New feature or request label Jul 14, 2026

@natalialuzuriaga natalialuzuriaga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Before approving, just wanted to ask about the current implementation choices and see whether other alternate approaches could be better suited. I also defer to Sachin though since he wrote the existing code!

Comment thread src/helper.ts Outdated
Comment thread src/main.ts Outdated
Comment thread src/helper.ts
@natalialuzuriaga

natalialuzuriaga commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Last thing: as specified in our OSPO Gen AI Policy that was just shipped, please fill out this information about Gen AI usage and add this to your PR description:

AI Usage

  • Generated AI was used in this contribution

If checked, please provide an explanation on how AI was used in the development of this pull request:

  • Description: Include a high level description of Gen AI utilization
  • Type of assistance:
     - [ ] Code generation
     - [ ] Documentation
     - [ ] Debugging
     - [ ] Testing
     - [ ] Refactoring
     - [ ] Other:
  • Scope of usage: Which files, functions, or sections were AI-assisted
  • AI System used:
     - [ ] ChatGPT
     - [ ] Claude
     - [ ] Gemini
     - [ ] GitHub Copilot
  • Level of modification:
     - [ ] As-is
     - [ ] Modified
     - [ ] Used as inspiration
  • Prompts used: Please list or explain prompts that were used to develop this contribution

@sachin-panayil sachin-panayil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the logic is great but following along with Natalias comment, we should stick with the design patterns unless truly necessary

@jjijon7000

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants