QAPI Integration for Python Microservices
SeeR — QAPI integration with GitHub Actions for continuous impact analysis on Python projects.
This document walks you through everything you need to connect SeeR (QAPI) to a GitHub repository so that API impact analysis runs automatically on Pull Requests. It includes step‑by‑step setup, the recommended GitHub Actions workflow, secrets required, policy guidance (no shell scripts in PRs), troubleshooting, and FAQs.
Table of contents
Summary
Quick overview
Runs QAPI impact analysis on Pull Requests to your integration branch.
Publishes results as GitHub Issues with the
impact-analysislabel.Requires a PAT, GitHub Actions workflow, and repository secrets.
Once configured, your repository will trigger SeeR's QAPI impact analysis whenever a Pull Request targets your chosen integration branch (for example develop or main). Results are published as GitHub Issues (label impact-analysis) and visible in the Actions tab.
Prerequisites
A GitHub repository containing your Python API code and OpenAPI specs.
Admin permissions (or repo settings access) to add Actions/workflows and repository secrets.
Basic familiarity with GitHub Actions and branching/PR workflows.
1) Create a GitHub Personal Access Token (PAT)
You will need a PAT so QAPI can interact with the repository. Create one with the scopes below.
Steps:
Go to GitHub:
Settings > Developer settings > Personal access tokens > Tokens (classic).Click Generate new token (classic).
Add a descriptive name (for example:
SeeR-QAPI-Python-integration).Set an expiration according to your security policy (recommended).
Select scopes:
repo(Full control of private repositories)workflow(Read/write GitHub Actions workflows)admin:repo_hook(Manage webhooks)read:org(Optional: read org metadata)
Generate the token and copy it somewhere secure. You will add it to the repository secrets in Step 3.
Tip: Store the PAT in your team's password manager so it can be rotated safely.
2) Add the GitHub Actions workflow (code-impact.yml)
Create the folder .github/workflows/ (if it doesn't exist) and add code-impact.yml with the content below. Update the target branch name (e.g., develop) and secret names as required by your environment.
How this workflow works (brief)
Triggers on PR events targeting your integration branch.
Checks out the full repository history to compute diffs.
Runs the Qyrus impact analyzer action and waits for the analysis to publish a GitHub Issue labeled
impact-analysis.
3) Configure repository secrets
In the repository: Settings > Secrets > Actions add the following secrets (names, example values, and descriptions):
IMPACT_API_URL
https://stg-gateway.qyrus.com:8243/impact-dispatcher/v1/analyze-impact
The endpoint for the Python Impact Analyzer service that SeeR (QAPI) communicates with.
API_ACCESS_TOKEN
Bearer 90540897-748a-3ef2-b3a3-c6f8f42022da
Your authentication token for the Qyrus gateway.
GITHUB_TOKEN
YOUR_GENERATED_PAT_FROM_STEP_1
The GitHub Personal Access Token you generated in Step 1.
WORKSPACE_NAME
MyTeamWorkspace
Your workspace name in QAPI.
SUITE_NAME
RegressionSuite
The name of the test suite in QAPI where your APIs are present.
ENVIRONMENT_NAME
Global Default
The environment name in QAPI for test execution.
PASSWORD
securePassword123!
Your password for logging into QAPI.
Note: Never hard-code secrets in workflow files or source code.
Best practices & policy
⚠️ Policy: No shell scripts (.sh) in PRs
Before opening a Pull Request for QAPI integration, ensure that there are no shell scripts (files ending in .sh, e.g., start.sh) present in either the source or the target branch.
Why:
Security: Executable scripts in branches may run arbitrary commands and increase risk.
Portability: CI runners differ; workflows provide a consistent, documented environment.
Predictability: Centralizing build/run steps in workflow files reduces surprises during CI.
Risk of abuse: Shell scripts can be used to gain system access or inject malicious code (see React2Shell).
Checklist before creating a PR:
Troubleshooting
Problem: Workflow times out waiting for
impact-analysisissue.Check that the
IMPACT_API_URLandAPI_ACCESS_TOKENsecrets are correct and reachable from the runner.Inspect the
Qyrus Python Impact Analysisstep logs for errors.
Problem: Action fails to checkout or compute diffs.
Ensure
fetch-depth: 0is set onactions/checkoutso git history is available.
Problem: Missing permissions to create issues.
Confirm the workflow
permissionsincludeissues: writeand that the PAT has required scopes.
Done! SeeR (via QAPI) is Now Linked to GitHub!
Once these steps are complete:
Automated tests will trigger based on your workflow configuration (e.g., with every commit if you set on: push).
You’ll see the reports and results directly as new GitHub Issues (with the
impact-analysislabel) and in the GitHub Actions tab, providing immediate feedback on your code changes!
Last updated