Conversation
因为插件可以导入 providers 里的东西而 providers 不应该导入插件里的东西
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #394 +/- ##
==========================================
+ Coverage 93.72% 93.89% +0.16%
==========================================
Files 41 40 -1
Lines 2311 2342 +31
==========================================
+ Hits 2166 2199 +33
+ Misses 145 143 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull Request Overview
This PR enables passing registry update data via GitHub Action artifacts by serializing and downloading artifact data, refactoring the store update flow, and updating related tests and configurations.
- Introduce
RegistryArtifactDataand updateRegistryUpdatePayloadto download and parse artifact JSON. - Refactor
StoreTest.registry_updateand its entrypoint to consume artifact data instead of payload. - Update publish utilities to save artifact after publish and trigger registry update via repository dispatch.
- Adjust tests, plugin configurations, and CI examples to support the artifact-based flow.
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/conftest.py | Configure artifact_path and GitHub App environment variables |
| src/providers/constants.py | Add REGISTRY_DATA_NAME constant for artifact filename |
| src/providers/models.py | Define RepoInfo, AuthorInfo, RegistryArtifactData, and update RegistryUpdatePayload |
| src/providers/store_test/store.py | Change registry_update to accept RegistryArtifactData |
| src/providers/store_test/main.py | Use get_artifact_data and pass artifact data to registry update |
| src/plugins/github/plugins/publish/utils.py | Save artifact data and adjust dispatch logic for registry update |
| src/plugins/github/config.py | Add artifact_path setting in plugin config |
| examples/store-test.yml | Set GitHub App secrets for Artifact workflow |
| examples/noneflow.yml | Add artifact upload step and configure artifact_path |
Comments suppressed due to low confidence (4)
src/plugins/github/config.py:19
- The
Pathtype is used forartifact_pathbut not imported. Addfrom pathlib import Pathat the top of the file to avoid a NameError.
artifact_path: Path = Field(
src/plugins/github/plugins/publish/utils.py:278
- [nitpick] After triggering the dispatch event, consider breaking out of the loop to avoid creating multiple dispatches if multiple matching artifacts are present.
if artifact.name == "noneflow":
examples/store-test.yml:56
- [nitpick] The example maps
PRIVATE_KEYtosecrets.APP_KEY. For clarity and consistency, consider renaming the secret tosecrets.PRIVATE_KEYor updating the variable to match the actual secret name.
PRIVATE_KEY: ${{ secrets.APP_KEY }}
examples/noneflow.yml:61
- [nitpick] Trailing commas in block mappings can be interpreted as part of the string value in YAML. Remove the trailing comma to prevent unintended characters in the value.
"registry_repository": "nonebot/registry",
copilot: [nitpick] After triggering the dispatch event, consider breaking out of the loop to avoid creating multiple dispatches if multiple matching artifacts are present.
close #392