Implement JSON output for external consumers and update workflow#2079
Implement JSON output for external consumers and update workflow#2079marco-s wants to merge 2 commits into
Conversation
Added functionality to write a JSON bundle for external consumers, including schema version and generation timestamp.
✅ Deploy Preview for pytorch-dot-org-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| write_output(js_content) | ||
|
|
||
| # Also write the JSON file for the external consumer | ||
| write_platforms_json(platform_data, markdown_content, str(BASE_DIR / JSON_OUT_PATH)) |
There was a problem hiding this comment.
Hi @marco-s, would you mind saving this file to the Asset directory instead? I believe the correct path should be ASSETS_DIR/JSON_OUT_PATH, right? :D
There was a problem hiding this comment.
Hi @fffrog! I initially thought about putting this in the assets folder. Since that's mostly for JS/CSS, etc., I ended up grouping it in the base dir with the other JSON files instead so they all stay together.
|
Hi @marco-s , thank you for updats, it look good to me. Parsing a Json is very easy compared to parsing a js file :D |
|
Hi @albanD, would you mind helping to review this PR, thank you in advance. Why we need those changesThe JSON is easier to parse than JS file from WP side, so we need to save the output into JSON and release it in the master branch for website. |
|
Thanks for fixing the CI error @marco-s |
albanD
left a comment
There was a problem hiding this comment.
Outputting json sounds fair. But the workflow update needs to be inspected a lot closer.
| set -ex | ||
| python3 ./scripts/gen_additional_platforms.py | ||
| - name: Create Issue if failed | ||
| uses: dacbd/create-issue-action@main |
There was a problem hiding this comment.
We should pin to specific sha
| labels: bug | ||
| body: Updating additional platforms failed, please fix gen_additional_platforms.py | ||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v3 |
There was a problem hiding this comment.
Here as well, we can pin to specific sha
There was a problem hiding this comment.
+1 lets pin sha for all third party actions
| assignees: ${{github.actor}} | ||
| labels: bug | ||
| body: Updating additional platforms failed, please fix gen_additional_platforms.py | ||
| - name: Create Pull Request |
There was a problem hiding this comment.
Is this new that we're opening PRs here? Why and How?
| run: | | ||
| set -ex | ||
| python3 ./scripts/gen_additional_platforms.py | ||
| - name: Create Issue if failed |
There was a problem hiding this comment.
Lets actually remove this step. This repo is in maintenance mode currently, we don't need to create issues.
| set -ex | ||
| python3 ./scripts/gen_additional_platforms.py | ||
| - name: Create Issue if failed | ||
| uses: dacbd/create-issue-action@main |
There was a problem hiding this comment.
This has not been updated in 2+ years, and I bet we have different examples of creating issues. Should we still be using this actions?
Description
This pull request enhances the
gen_additional_platforms.pyscript to generate a new JSON bundle for external consumers. And, it updates the workflow to install required Python dependencies, adds automated error reporting and pull request creation.Motivation
Make it easier for external consumers to get the additional platforms matrix information. This PR adds to #2072.