Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/openapi-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Generate OpenAPI Specification

on:
push:
branches:
- master
paths:
- 'config/api.yml'
- 'lib/manageiq/api/open_api/**'
- 'app/controllers/api/**'
schedule:
- cron: 0 0 * * 0
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions:
Comment thread
agrare marked this conversation as resolved.
contents: read
jobs:
openapi-generate:
runs-on: ubuntu-latest
services:
postgres:
image: manageiq/postgresql:13
env:
POSTGRESQL_USER: root
POSTGRESQL_PASSWORD: smartvm
POSTGRESQL_DATABASE: vmdb_test
options: "--health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5"
ports:
- 5432:5432
env:
PGHOST: localhost
PGPASSWORD: smartvm
RAILS_ENV: test
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up system
run: bin/before_install
- name: Set up Ruby
Comment thread
agrare marked this conversation as resolved.
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
timeout-minutes: 30
- name: Prepare tests
run: bin/setup
- name: Generate OpenAPI specification
run: bundle exec rake manageiq:api:openapi_generate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to self that I need to associate this token with this repo after merge.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second reminder, I also need to fork this repo on the bot account.

commit-message: "Update OpenAPI specification"
title: "Update OpenAPI specification"
body: |
## OpenAPI Specification Update

This PR updates the OpenAPI specification (`config/openapi.json`) based on the current API configuration.

### Changes
- Regenerated OpenAPI spec from `config/api.yml`
- Updated schemas, paths, and operations

### Generated by
- Workflow: `${{ github.workflow }}`
- Run: `${{ github.run_number }}`
- Triggered by: `${{ github.workflow_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`

### Review Checklist
- [ ] Verify new/modified endpoints are documented correctly
- [ ] Check parameter definitions are accurate
- [ ] Ensure response schemas match actual API responses
- [ ] Validate security schemes are properly defined

---
*This PR was automatically generated by GitHub Actions*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is kind of cool - wondering if we should add that to the other ones, perhaps along with a reference back to the action that generated it. Maybe the "generated by" here can be the link.

branch: openapi_generate
delete-branch: true
push-to-fork: miq-bot/manageiq-api
labels: |
enhancement
add-paths: |
config/openapi.json
Loading