Skip to content

Conversation

nvdaes
Copy link
Contributor

@nvdaes nvdaes commented Oct 13, 2025

  • Add changelog
  • Add changelog to json schema
  • Address code review
  • Update _validate/addonVersion_schema.json
  • Apply suggestions from code review
  • Address review
  • Address review
  • Assign None to changelog when appropriate
  • Pre-commit auto-fix
  • Fix
  • Fix
  • Remove unassigned addonData
  • Fix test
  • Fix error message
  • harmonize test for changelog with homepage
  • Fix test
  • Remove function
  • Commend python preference to test locally
  • Lint fixes
  • Add translated changelog optional and fix linting errors by casting to str
  • Fix pyproject
  • Add ignore type comments
  • Add ignore type comment
  • Address review
  • Address review
  • Remove accidentally committed files
  • Try to ensure that homepage and changelog are str or None
  • Address feedback
  • Apply suggestions from code review
  • Apply suggestions from code review
  • Apply suggestions from code review
  • Update _validate/createJson.py
  • Apply review suggestions
  • Update createJson casting fields to str according to schema

@nvdaes nvdaes changed the title changelog Add changelog casting optionals to str according to schema Oct 13, 2025
@nvdaes
Copy link
Contributor Author

nvdaes commented Oct 13, 2025

@seanbudd , I'll test with this. I think we should cast optionals to str according to json schema to create the json file, since a string is expected, not None.

@seanbudd
Copy link
Member

@nvdaes - please keep this as None and avoiding casting to strings as requested in #48 (comment)

We should be able to handle None values safely

@nvdaes
Copy link
Contributor Author

nvdaes commented Oct 14, 2025

Sean wrote:

We should be able to handle None values safely

I've added the null type to some properties. I wonder if we should make the description optional, and in this case, if it should be a required field in the json schema and translations. I'll wait for your feedback before moving forward.

@seanbudd seanbudd requested review from Copilot and seanbudd and removed request for seanbudd October 14, 2025 23:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds changelog support to the addon validation system, allowing add-ons to include changelog information that gets validated and processed similarly to existing fields like homepage and description.

Key changes:

  • Added changelog field validation to ensure manifest and submission data match
  • Updated JSON schema to support optional changelog fields for both main and translated content
  • Enhanced data structures and processing to handle changelog as an optional string field

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_validate.py Added test class for changelog validation and updated SHA hash for test data
tests/test_createJson.py Added changelog field to test data generation
tests/testData/manifest.ini Added sample changelog content to test manifest
tests/testData/addons/fake/13.0.0.json Added changelog field to test JSON and updated SHA hash
pyproject.toml Removed python-preference configuration
_validate/validate.py Added checkChangelogMatches function and integrated it into validation pipeline
_validate/regenerateTranslations.py Added changelog handling for translation regeneration
_validate/createJson.py Enhanced AddonData class and processing to support optional changelog field
_validate/addonVersion_schema.json Updated JSON schema to include changelog fields with null type support
_validate/addonManifest.py Added changelog field to manifest specification and translation handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

changelog = None
if changelog != submission.get("changelog"):
yield (
f"Submission 'changelog' must be set to '{manifest.get('changelog')}' " # type: ignore[reportUnknownMemberType]
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

The error message uses manifest.get('changelog') which could return the string 'None' instead of the processed changelog variable that handles this case. Use the processed changelog variable for consistency.

Suggested change
f"Submission 'changelog' must be set to '{manifest.get('changelog')}' " # type: ignore[reportUnknownMemberType]
f"Submission 'changelog' must be set to '{changelog}' "

Copilot uses AI. Check for mistakes.

"language": langCode,
"displayName": manifest["summary"],
"description": manifest["description"],
"changelog": cast(str, translatedChangelog),
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Casting translatedChangelog to str when it can be None will cause a runtime error. The cast should be cast(str | None, translatedChangelog) or the None case should be handled separately.

Suggested change
"changelog": cast(str, translatedChangelog),
"changelog": cast(str | None, translatedChangelog),

Copilot uses AI. Check for mistakes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants