chore: adds script and workflow to post docs#5
Merged
Conversation
There was a problem hiding this comment.
4 issues found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/post_requests.py">
<violation number="1" location="scripts/post_requests.py:24">
P1: SCHEMA_MAP uses sources/claims/proofs instead of the documented grant_requests/admission_requests mapping, so new docs in the tracked folders won’t be posted.</violation>
<violation number="2" location="scripts/post_requests.py:50">
P1: Use the documented Authorization: Bearer header instead of X-API-Key so the POST requests authenticate correctly.</violation>
<violation number="3" location="scripts/post_requests.py:64">
P2: Read BASE_URL (as documented) instead of API_BASE_URL, otherwise the workflow won’t find the configured base URL.</violation>
</file>
<file name=".github/workflows/api-calls.yml">
<violation number="1" location=".github/workflows/api-calls.yml:29">
P2: This diff only checks the last commit. A push to main can contain multiple commits, so new documents added earlier in the push won’t be detected or POSTed. Use the push range (`github.event.before` → `github.sha`) instead of `HEAD~1`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Signed-off-by: Amit Singh <singhamitch@outlook.com>
473bb71 to
e0adcad
Compare
Contributor
Author
|
@semmet95 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
3 issues found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/post_requests.py">
<violation number="1" location="scripts/post_requests.py:19">
P2: Narrow the import fallback to `ImportError` so real module errors are not silently hidden.</violation>
</file>
<file name="AGENTS.md">
<violation number="1" location="AGENTS.md:22">
P3: Workflow filename in docs is incorrect (`post_on_merge.yml`); the actual file is `api-calls.yml`.</violation>
</file>
<file name="scripts/validate.py">
<violation number="1" location="scripts/validate.py:12">
P2: Only catch ImportError here. A broad `except Exception` masks real errors in `scripts.common` and makes debugging failures harder.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Signed-off-by: Amit Singh <singhamitch@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds a merge workflow and Python script to auto-POST newly added
sources/,claims/, andproofs/docs to API endpoints defined inoapi.yaml. Also adds shared loaders, aligns validator mappings, updates CI/docs, and improves POST error handling.New Features
.github/workflows/post_on_merge.ymlto POST new docs on push tomainor manual runs. Finds added files in the latest commit undersources/,claims/,proofs/and only posts when present.scripts/post_requests.pyto loadoapi.yaml, map$refschemas to POST endpoints, and send JSON withX-API-Key. Exits early ifAPI_BASE_URLorAPI_KEYis missing. Prints per-file status and now catchesurllib.error.HTTPErrorto report status/body.scripts/common.pywith shared YAML/JSON loaders;scripts/validate.pynow imports it and aligns folder-to-schema mappings (SourceInput,ClaimInput,ProofInput)..github/workflows/validate.ymlto validatesources/**,claims/**, andproofs/**. UpdatedAGENTS.mdand added__pycache__to.gitignore.Migration
API_BASE_URLandAPI_KEY.oapi.yamldefines POST paths whoserequestBodyschema$refs match repository schema names so the script can resolve endpoints.Written for commit f6f682e. Summary will update on new commits. Review in cubic