Skip to content

Better add-on download handling#9858

Open
seanbudd wants to merge 20 commits into
masterfrom
betterAddonDownloadHandling
Open

Better add-on download handling#9858
seanbudd wants to merge 20 commits into
masterfrom
betterAddonDownloadHandling

Conversation

@seanbudd

@seanbudd seanbudd commented Jun 16, 2026

Copy link
Copy Markdown
Member

Fixes #3253

The code to initially download the add-on has bad error handling.
That means for bad URLs / 404s, no good communication to the submitter happens.
Recent example: #9821
We can fix this by using our reusable validation code to download the add-on with instead.

However, when using it, if a 404 is raised from urlopen it causes an exception, which when logged doesn't provide a clear error message. This caused #3253.

Unit tests have been added (AI gen) and system tests have been updated.


  • The add-on download and error handling steps were removed from the .github/workflows/sendJsonFile.yml workflow, centralizing this logic in the Python validation code instead. (.github/workflows/sendJsonFile.yml .github/workflows/sendJsonFile.ymlL36-L51)
  • The downloadAndValidateAddon function was added to validate.py to handle both URL validation and downloading the add-on, yielding errors and raising exceptions as needed. (validation/_validate/validate.py validation/_validate/validate.pyR330-R346)
  • The main function in createJson.py now calls downloadAndValidateAddon and outputs errors if the download or validation fails, improving error handling and reporting. (validation/_validate/createJson.py validation/_validate/createJson.pyR228-R232)
  • The validateSubmission function was updated to use downloadAndValidateAddon, simplifying the code and ensuring consistent validation logic. (validation/_validate/validate.py validation/_validate/validate.pyL334-R363)
  • Improved error handling in downloadAddon to yield and raise exceptions with descriptive messages on failure. (validation/_validate/validate.py validation/_validate/validate.pyR87-R91)

Copilot AI 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.

Pull request overview

This PR centralizes add-on downloading and URL validation in the Python validation layer (instead of the GitHub Actions workflow) to improve submitter-facing error reporting, especially for bad URLs/404s (Fixes #3253).

Changes:

  • Removed the workflow curl download step so downloading happens via the validation scripts.
  • Added downloadAndValidateAddon to reuse URL-format validation + download logic.
  • Updated createJson.py and validateSubmission to use the centralized download+validation path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
validation/_validate/validate.py Adds shared download+URL validation helper and adjusts download error handling.
validation/_validate/createJson.py Uses the shared helper before loading the manifest to improve error reporting.
.github/workflows/sendJsonFile.yml Removes workflow-level download step in favor of Python-side handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread validation/_validate/validate.py Outdated
Comment thread validation/_validate/validate.py
Comment thread validation/_validate/validate.py Outdated
Comment thread validation/_validate/createJson.py Outdated
Comment thread validation/_validate/validate.py Outdated
@seanbudd

Copy link
Copy Markdown
Member Author

pre-commit.ci run

@seanbudd seanbudd marked this pull request as draft June 16, 2026 03:21

Copilot AI 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.

Pull request overview

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

Comment thread validation/_validate/validate.py
Comment thread validation/_validate/validate.py Outdated
@seanbudd seanbudd marked this pull request as ready for review June 16, 2026 04:54
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.

404 Validation error comments should specify the failing URL

2 participants