358 lines
14 KiB
YAML
358 lines
14 KiB
YAML
name: InfluxDB 3 Release Documentation
|
||
|
||
on:
|
||
workflow_dispatch:
|
||
inputs:
|
||
product:
|
||
description: 'Product being released'
|
||
required: true
|
||
type: choice
|
||
options:
|
||
- core
|
||
- enterprise
|
||
- clustered
|
||
- cloud-dedicated
|
||
- cloud-serverless
|
||
version:
|
||
description: 'Release tag name (must exist in git tags, e.g., v3.0.0 or "local" for dev)'
|
||
required: true
|
||
type: string
|
||
previous_version:
|
||
description: 'Previous release tag name (must exist in git tags, e.g., v2.9.0)'
|
||
required: true
|
||
type: string
|
||
dry_run:
|
||
description: 'Dry run (do not create PRs or issues)'
|
||
required: false
|
||
type: boolean
|
||
default: true
|
||
|
||
jobs:
|
||
generate-release-notes:
|
||
name: Generate Release Notes
|
||
runs-on: ubuntu-latest
|
||
outputs:
|
||
generated: ${{ steps.generate.outputs.generated }}
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Set up Node.js
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: '18'
|
||
cache: 'yarn'
|
||
|
||
- name: Install dependencies
|
||
run: yarn install --frozen-lockfile
|
||
|
||
- name: Generate release notes
|
||
id: generate
|
||
run: |
|
||
echo "Generating release notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}"
|
||
|
||
# TODO: Call the actual generate-release-notes script when it exists
|
||
# node ./helper-scripts/influxdb3-monolith/generate-release-notes.js \
|
||
# --product ${{ github.event.inputs.product }} \
|
||
# --version ${{ github.event.inputs.version }} \
|
||
# --previous ${{ github.event.inputs.previous_version }}
|
||
|
||
# For now, create a placeholder
|
||
mkdir -p helper-scripts/output/release-notes
|
||
echo "# Release Notes for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}" > helper-scripts/output/release-notes/release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}.md
|
||
echo "generated=true" >> $GITHUB_OUTPUT
|
||
|
||
- name: Upload release notes
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: release-notes-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
|
||
path: helper-scripts/output/release-notes/
|
||
retention-days: 30
|
||
|
||
audit-cli-documentation:
|
||
name: Audit CLI Documentation
|
||
needs: generate-release-notes
|
||
runs-on: ubuntu-latest
|
||
if: needs.generate-release-notes.outputs.generated == 'true' && contains(fromJSON('["core", "enterprise"]'), github.event.inputs.product)
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Set up Node.js
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: '18'
|
||
cache: 'yarn'
|
||
|
||
- name: Install dependencies
|
||
run: yarn install --frozen-lockfile
|
||
|
||
- name: Pull Docker images for version
|
||
run: |
|
||
VERSION="${{ github.event.inputs.version }}"
|
||
PRODUCT="${{ github.event.inputs.product }}"
|
||
|
||
if [ "$PRODUCT" == "both" ]; then
|
||
docker pull influxdb:${VERSION}-core || true
|
||
docker pull influxdb:${VERSION}-enterprise || true
|
||
else
|
||
docker pull influxdb:${VERSION}-${PRODUCT} || true
|
||
fi
|
||
|
||
- name: Run CLI audit
|
||
run: |
|
||
PRODUCT="${{ github.event.inputs.product }}"
|
||
VERSION="${{ github.event.inputs.version }}"
|
||
|
||
node ./helper-scripts/influxdb3-monolith/audit-cli-documentation.js $PRODUCT $VERSION
|
||
|
||
- name: Upload CLI audit reports
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: cli-audit-release-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
|
||
path: helper-scripts/output/cli-audit/
|
||
retention-days: 90
|
||
|
||
audit-distributed-documentation:
|
||
name: Audit Distributed Products Documentation
|
||
needs: generate-release-notes
|
||
runs-on: ubuntu-latest
|
||
if: needs.generate-release-notes.outputs.generated == 'true' && contains(fromJSON('["clustered", "cloud-dedicated", "cloud-serverless"]'), github.event.inputs.product)
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Set up Node.js
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: '18'
|
||
cache: 'yarn'
|
||
|
||
- name: Install dependencies
|
||
run: yarn install --frozen-lockfile
|
||
|
||
- name: Run distributed products audit
|
||
run: |
|
||
PRODUCT="${{ github.event.inputs.product }}"
|
||
VERSION="${{ github.event.inputs.version }}"
|
||
|
||
echo "Auditing distributed product: $PRODUCT v$VERSION"
|
||
# TODO: Implement distributed products audit for release
|
||
# This would audit API docs, deployment guides, configuration references
|
||
# node ./helper-scripts/influxdb3-distributed/audit-documentation.js $PRODUCT $VERSION
|
||
|
||
# For now, create placeholder report
|
||
mkdir -p helper-scripts/output/distributed-audit
|
||
cat > helper-scripts/output/distributed-audit/release-audit-$PRODUCT-$VERSION.md << 'EOF'
|
||
# Release Audit Report - Distributed Products
|
||
|
||
**Product:** $PRODUCT
|
||
**Version:** $VERSION
|
||
**Date:** $(date)
|
||
**Status:** Placeholder - audit not yet implemented
|
||
|
||
## Areas to Audit
|
||
- API documentation completeness
|
||
- Deployment guide accuracy
|
||
- Configuration reference updates
|
||
- Integration guide updates
|
||
- Version-specific feature documentation
|
||
|
||
## TODO
|
||
- Implement API documentation audit
|
||
- Implement deployment guide audit
|
||
- Implement configuration reference audit
|
||
- Implement integration guide audit
|
||
EOF
|
||
|
||
- name: Upload distributed audit reports
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: distributed-audit-release-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}
|
||
path: helper-scripts/output/distributed-audit/
|
||
retention-days: 90
|
||
|
||
create-documentation-pr:
|
||
name: Create Documentation PR
|
||
needs: [generate-release-notes, audit-cli-documentation, audit-distributed-documentation]
|
||
runs-on: ubuntu-latest
|
||
if: github.event.inputs.dry_run != 'true' && always() && needs.generate-release-notes.result == 'success'
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Download artifacts
|
||
uses: actions/download-artifact@v4
|
||
with:
|
||
path: artifacts/
|
||
|
||
- name: Create release branch
|
||
run: |
|
||
BRANCH="release-docs-${{ github.event.inputs.product }}-${{ github.event.inputs.version }}"
|
||
git checkout -b $BRANCH
|
||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
||
|
||
- name: Copy release notes to docs
|
||
run: |
|
||
# TODO: Copy release notes to appropriate documentation location
|
||
echo "Release notes would be copied here"
|
||
|
||
- name: Create Pull Request
|
||
uses: peter-evans/create-pull-request@v5
|
||
with:
|
||
token: ${{ secrets.GITHUB_TOKEN }}
|
||
branch: ${{ env.BRANCH }}
|
||
title: "docs: Release documentation for ${{ github.event.inputs.product }} v${{ github.event.inputs.version }}"
|
||
body: |
|
||
## Release Documentation Update
|
||
|
||
This PR contains documentation updates for **${{ github.event.inputs.product }} v${{ github.event.inputs.version }}**
|
||
|
||
### Included Updates:
|
||
- [ ] Release notes
|
||
- [ ] Version updates
|
||
- [ ] CLI documentation audit results
|
||
|
||
### Artifacts:
|
||
- [Release Notes](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
||
- [CLI Audit Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
||
|
||
### Manual Review Needed:
|
||
Please review the CLI audit report for any missing or outdated documentation that needs to be updated.
|
||
|
||
---
|
||
*This PR was automatically generated by the release workflow.*
|
||
labels: |
|
||
documentation
|
||
release
|
||
${{ github.event.inputs.product }}
|
||
draft: true
|
||
|
||
create-audit-issue:
|
||
name: Create Audit Issue
|
||
needs: [audit-cli-documentation, audit-distributed-documentation]
|
||
runs-on: ubuntu-latest
|
||
if: github.event.inputs.dry_run != 'true' && always() && (needs.audit-cli-documentation.result == 'success' || needs.audit-distributed-documentation.result == 'success')
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Download audit reports
|
||
uses: actions/download-artifact@v4
|
||
with:
|
||
path: audit-reports/
|
||
|
||
- name: Create issue from audit
|
||
uses: actions/github-script@v7
|
||
with:
|
||
script: |
|
||
const fs = require('fs');
|
||
const path = require('path');
|
||
const product = '${{ github.event.inputs.product }}';
|
||
const version = '${{ github.event.inputs.version }}';
|
||
|
||
let auditReports = [];
|
||
let hasIssues = false;
|
||
|
||
// Check for CLI audit report
|
||
const cliAuditPath = `audit-reports/cli-audit-release-${product}-${version}`;
|
||
if (fs.existsSync(cliAuditPath)) {
|
||
const files = fs.readdirSync(cliAuditPath);
|
||
const cliAuditFile = files.find(f => f.includes('documentation-audit'));
|
||
if (cliAuditFile) {
|
||
const report = fs.readFileSync(path.join(cliAuditPath, cliAuditFile), 'utf8');
|
||
const hasMissingOptions = report.includes('⚠️ Missing from docs');
|
||
const hasExtraOptions = report.includes('ℹ️ Documented but not in CLI');
|
||
if (hasMissingOptions || hasExtraOptions) {
|
||
auditReports.push({
|
||
type: 'CLI',
|
||
content: report
|
||
});
|
||
hasIssues = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
// Check for distributed audit report
|
||
const distributedAuditPath = `audit-reports/distributed-audit-release-${product}-${version}`;
|
||
if (fs.existsSync(distributedAuditPath)) {
|
||
const files = fs.readdirSync(distributedAuditPath);
|
||
const distributedAuditFile = files.find(f => f.includes('release-audit'));
|
||
if (distributedAuditFile) {
|
||
const report = fs.readFileSync(path.join(distributedAuditPath, distributedAuditFile), 'utf8');
|
||
// For now, always include distributed audit reports since they're placeholders
|
||
auditReports.push({
|
||
type: 'Distributed Products',
|
||
content: report
|
||
});
|
||
hasIssues = true;
|
||
}
|
||
}
|
||
|
||
if (hasIssues && auditReports.length > 0) {
|
||
// Create comprehensive issue
|
||
const issueBody = [
|
||
'## Release Documentation Audit Results',
|
||
'',
|
||
`The following documentation issues were found during the release of **${product} v${version}**:`,
|
||
'',
|
||
...auditReports.map(report => [
|
||
`### ${report.type} Audit`,
|
||
'',
|
||
report.content,
|
||
''
|
||
]).flat(),
|
||
'### Action Items:',
|
||
'- [ ] Review and update documentation for missing or outdated content',
|
||
'- [ ] Verify all examples work with the new version',
|
||
'- [ ] Update any version-specific content',
|
||
'- [ ] Remove documentation for deprecated features',
|
||
'',
|
||
'---',
|
||
'*This issue was automatically generated during the release process.*'
|
||
].join('\n');
|
||
|
||
await github.rest.issues.create({
|
||
owner: context.repo.owner,
|
||
repo: context.repo.repo,
|
||
title: `Documentation Updates Needed - ${product} v${version}`,
|
||
body: issueBody,
|
||
labels: ['documentation', 'release', product, 'audit']
|
||
});
|
||
|
||
console.log('Created issue for documentation updates');
|
||
} else {
|
||
console.log('No documentation issues found - skipping issue creation');
|
||
}
|
||
|
||
influxdb3-monolith-release-summary:
|
||
name: Release Summary
|
||
needs: [generate-release-notes, audit-cli-documentation, audit-distributed-documentation, create-documentation-pr, create-audit-issue]
|
||
runs-on: ubuntu-latest
|
||
if: always()
|
||
|
||
steps:
|
||
- name: Generate summary
|
||
run: |
|
||
echo "# Release Documentation Summary" >> $GITHUB_STEP_SUMMARY
|
||
echo "" >> $GITHUB_STEP_SUMMARY
|
||
echo "## Release Information" >> $GITHUB_STEP_SUMMARY
|
||
echo "- **Product**: ${{ github.event.inputs.product }}" >> $GITHUB_STEP_SUMMARY
|
||
echo "- **Version**: ${{ github.event.inputs.version }}" >> $GITHUB_STEP_SUMMARY
|
||
echo "- **Previous Version**: ${{ github.event.inputs.previous_version }}" >> $GITHUB_STEP_SUMMARY
|
||
echo "- **Dry Run**: ${{ github.event.inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY
|
||
echo "" >> $GITHUB_STEP_SUMMARY
|
||
|
||
echo "## Workflow Results" >> $GITHUB_STEP_SUMMARY
|
||
echo "| Step | Status |" >> $GITHUB_STEP_SUMMARY
|
||
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
|
||
echo "| Generate Release Notes | ${{ needs.generate-release-notes.result }} |" >> $GITHUB_STEP_SUMMARY
|
||
echo "| CLI Documentation Audit | ${{ needs.audit-cli-documentation.result }} |" >> $GITHUB_STEP_SUMMARY
|
||
echo "| Distributed Documentation Audit | ${{ needs.audit-distributed-documentation.result }} |" >> $GITHUB_STEP_SUMMARY
|
||
echo "| Create Documentation PR | ${{ needs.create-documentation-pr.result }} |" >> $GITHUB_STEP_SUMMARY
|
||
echo "| Create Audit Issue | ${{ needs.create-audit-issue.result }} |" >> $GITHUB_STEP_SUMMARY
|
||
echo "" >> $GITHUB_STEP_SUMMARY
|
||
|
||
if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then
|
||
echo "**Note**: This was a dry run. No PRs or issues were created." >> $GITHUB_STEP_SUMMARY
|
||
fi |