Skip to content

feat: add --auto-file-issue flag to create GitHub Issues on test failure#429

Open
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:feat/auto-file-github-issue-on-test-failure
Open

feat: add --auto-file-issue flag to create GitHub Issues on test failure#429
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:feat/auto-file-github-issue-on-test-failure

Conversation

@A-d-i-t-y
Copy link
Copy Markdown

Summary

Adds --auto-file-issue flag to the test command that automatically
creates a structured GitHub Issue when contract tests fail in CI.

Problem

When microcks test fails in GitHub Actions CI, developers only see
a red check and plain text logs buried in CI output. There is no
automatic way to track, reproduce, or assign test failures.

Solution

Three new flags added to the test command:

  • --auto-file-issue: enables automatic GitHub Issue creation on failure
  • --github-token: GitHub personal access token
  • --github-repo: target repository in owner/repo format (e.g. org/repo)

Example Usage

microcks test 'Beer API:1.0' $URL POSTMAN
--microcksURL=$MICROCKS_URL
--auto-file-issue
--github-token=$GITHUB_TOKEN
--github-repo=org/repo

Example Issue Created Automatically

Title: [Microcks] Test Failed: Beer API v1.0

  • Failed Operations: POST /beer, DELETE /beer/{id}
  • Endpoint: https://api.example.com
  • Runner: POSTMAN
  • Reproduction command included
  • Link to full Microcks UI test results

Files Changed

  • cmd/test.go — added 3 new flags and auto-issue logic
  • pkg/connectors/github_client.go — new file for GitHub API integration
  • pkg/connectors/microcks_client.go — added TestResult structs and GetTestResultDetails method

Closes #428

When microcks test fails in GitHub Actions CI, this flag automatically
creates a structured GitHub Issue containing:
- Failed operations list
- Test endpoint and runner details
- Exact reproduction command
- Link to full test results on Microcks UI

New flags added:
- --auto-file-issue: enable automatic issue creation
- --github-token: GitHub personal access token
- --github-repo: target repository in owner/repo format

Closes microcks#428

Signed-off-by: Aditya <aaaditya1909@gmail.com>
@A-d-i-t-y
Copy link
Copy Markdown
Author

Hi @Harsh4902 @lbroudoux @Vaishnav88sk, I have raised this PR to implement the --auto-file-issue flag as discussed. When microcks test fails in GitHub Actions CI, this automatically creates a structured GitHub Issue with failed operations, reproduction command, and a link to full results on Microcks UI. Would love your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add --auto-file-issue flag to automatically create GitHub Issues on test failure

1 participant