Gate docs Pages-only upload step to main non-PR events#9
Conversation
There was a problem hiding this comment.
Pull request overview
This PR primarily updates the documentation GitHub Actions workflow so the “Upload build artifacts” step only runs for main-branch deployment-oriented events (push/workflow_dispatch on refs/heads/main), avoiding a deploy-adjacent Pages behavior on PR runs. In addition, it includes a broad set of Python cleanup changes across dynvision/ (unused imports, redundant pass removals), including an API-affecting change where dynvision.models is no longer exporting model classes.
Changes:
- Gate
.github/workflows/docs.yml“Upload build artifacts” to main-branchpush/workflow_dispatchevents. - Remove unused imports and redundant
passstatements across multipledynvision/modules. - Clear
dynvision/models/__init__.py(removing package-level re-exports of model classes).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
dynvision/models/resnet.py |
Removes a redundant pass in reset() (no functional change). |
dynvision/models/dyrcnn.py |
Cleans up unused typing imports. |
dynvision/models/cornet_rt.py |
Removes unused imports and an unnecessary pass in an empty sentinel class. |
dynvision/models/cordsnet.py |
Removes an unused configuration array (sizes). |
dynvision/models/alexnet.py |
Removes an unused component import. |
dynvision/models/__init__.py |
Removes package-level star re-exports (now empty), impacting from dynvision.models import ... imports. |
dynvision/model_components/recurrence.py |
Removes a redundant pass in an empty subclass body. |
dynvision/model_components/layer_connections.py |
Removes redundant pass statements from empty class bodies. |
dynvision/data/noise.py |
Removes unused imports (warnings, filter_kwargs). |
dynvision/data/ffcv_datasets.py |
Removes an unused variable, leaving a currently-useless expression statement. |
dynvision/data/ffcv_dataloader.py |
Cleans up unused typing imports and unused FFCV operation imports. |
dynvision/data/datasets.py |
Cleans up unused typing imports. |
dynvision/data/dataloader.py |
Cleans up unused typing imports. |
dynvision/base/temporal.py |
Removes redundant pass statements (no functional change). |
dynvision/base/storage.py |
Removes a redundant pass in reset() (no functional change). |
dynvision/base/coordination.py |
Removes a redundant pass in an exception handler. |
dynvision/base/__init__.py |
Removes redundant pass statements from empty subclass bodies. |
.github/workflows/docs.yml |
Gates artifact upload to non-PR main-branch deployment events. |
Comments suppressed due to low confidence (1)
dynvision/models/init.py:1
dynvision.modelsno longer re-exports the public model classes (file is now empty). This is a breaking API change for users/docs that rely onfrom dynvision.models import DyRCNNx4/AlexNet/CordsNetetc., and it is unrelated to the PR’s stated docs-workflow scope.
|
|
||
| # Get writer configuration | ||
| data_sample = dataset[0][0] | ||
| dataset[0][0] |
| commit_message: 'docs: deploy documentation from ${{ github.sha }}' | ||
|
|
||
| - name: Upload build artifacts | ||
| if: github.event_name == 'pull_request' | ||
| if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' | ||
| uses: actions/upload-artifact@v4 |
|
Closing: the Pages deployment was fixed by switching to native GitHub Actions artifact deployment (PR #8, merged) and clearing the stale gh-pages source binding. The deploy now succeeds without the queue loop, so this gating change is no longer needed. |
This PR addresses the review feedback on
#discussion_r3514827549: PR docs runs were executing a deploy-adjacent Pages step that should only run for main-branch deployment flows. The workflow now aligns upload behavior with non-PR main events.Problem addressed
Upload build artifactswas triggered onpull_request, which conflicted with the intended Pages deployment boundary.Workflow change
.github/workflows/docs.ymlto gate artifact upload to the same event/ref pattern used for deployment-oriented execution (pushorworkflow_dispatchonrefs/heads/main).Resulting behavior