Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1733fb7
feat: add diagnose guide && logs && deployment_id param on diagnose (…
ignacioboud Dec 17, 2025
43232d1
fix: diagnose checks (#112)
ignacioboud Dec 17, 2025
c71f6ea
fix: change service port conf selector (#115)
ignacioboud Dec 22, 2025
69617c1
Add support to configure the traffic manager nginx through a configmap
fedemaleh Dec 22, 2025
452b0dc
chore: add changelog
ignacioboud Dec 22, 2025
26f17d8
Merge pull request #116 from nullplatform/chore/changelog
fedemaleh Dec 22, 2025
8b57b6b
Merge branch 'beta' into feature/traffic-manager-configuration
fedemaleh Dec 22, 2025
198845e
Add comment with variable name to values
fedemaleh Dec 22, 2025
2b7cc3b
chore: add release worflow (#118)
ignacioboud Dec 29, 2025
1c7321a
fix: modify pod readiness (#119)
ignacioboud Dec 29, 2025
4f2a667
fix: change delete cluster objects to maintain only one deployment_id
ignacioboud Dec 29, 2025
40269ed
fix: add probe warning (#122)
ignacioboud Dec 29, 2025
2b9e338
Add status valdiation before action execution
fedemaleh Dec 29, 2025
654dc08
Fix status validation
fedemaleh Dec 29, 2025
424d59d
Update changelog
fedemaleh Dec 29, 2025
c122016
fix: add read only on action parameter (#124)
ignacioboud Dec 30, 2025
607c0b1
Review changes: improve logs
fedemaleh Dec 30, 2025
22dad91
Merge pull request #123 from nullplatform/feature/validate-status-on-…
fedemaleh Dec 30, 2025
e1507a8
Fix valid status for delete deployment
fedemaleh Dec 30, 2025
31ce67c
fix: make alb check more robust (#125)
ignacioboud Dec 30, 2025
1afee7a
Merge pull request #126 from nullplatform/fix/validate-status-on-action
fedemaleh Jan 5, 2026
60a3018
fix: change template type parameter (#127)
ignacioboud Jan 5, 2026
c9c7e68
feat: add skipped status (#128)
ignacioboud Jan 5, 2026
37db099
fix: upgrade go dependencies (#129)
ignacioboud Jan 5, 2026
e8f0ef4
Add support for namespace override through channel
fedemaleh Jan 5, 2026
919d4ff
Merge pull request #131 from nullplatform/fix/validate-status-on-action
fedemaleh Jan 5, 2026
2cbdbd2
Merge pull request #117 from nullplatform/feature/traffic-manager-con…
fedemaleh Jan 7, 2026
d2997dc
fix: change pod readiness (#130)
ignacioboud Jan 7, 2026
f0c0a14
feat: add visibleOn on tpl (#132)
ignacioboud Jan 7, 2026
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
354 changes: 354 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,354 @@
name: Release Management

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled, closed]
branches:
- main
workflow_dispatch:
inputs:
branch:
description: 'Branch to create release from'
required: true
type: string
default: 'main'
version:
description: 'Version number (e.g., 1.9.1)'
required: true
type: string

permissions:
contents: write
pull-requests: write
checks: write

jobs:
# Job 1: Check that PR has version label (runs on open/sync/label changes)
check-version-label:
if: |
github.event.pull_request.state == 'open' &&
github.head_ref == 'beta'
runs-on: ubuntu-latest

steps:
- name: Check for version label
uses: actions/github-script@v7
with:
script: |
const labels = context.payload.pull_request.labels.map(l => l.name);

// Find label that matches version pattern (v1.9.1 or 1.9.1)
const versionLabel = labels.find(l => /^v?\d+\.\d+\.\d+$/.test(l));

if (versionLabel) {
console.log(`Found version label: ${versionLabel}`);

// Post success comment
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.data.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('Version Label Check')
);

const body = `## ✅ Version Label Check\n\n**Version**: \`${versionLabel}\`\n\nThis PR is ready to merge. The CHANGELOG will be automatically updated with this version.`;

if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}
} else {
console.log('No version label found');

// Post error comment
const body = `## ❌ Version Label Check\n\n**Missing version label**\n\nPlease add a label with the version number (e.g., \`v1.9.1\` or \`1.9.1\`) before merging.\n\nThe version label will be used to automatically update the CHANGELOG.`;

const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.data.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('Version Label Check')
);

if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}

core.setFailed('Missing version label');
}

# Job 2: Create release on merge (runs when PR is merged)
create-release:
if: |
github.event.pull_request.merged == true &&
github.event.pull_request.head.ref == 'beta'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version from PR labels
id: version
uses: actions/github-script@v7
with:
script: |
const labels = context.payload.pull_request.labels.map(l => l.name);

// Find label that matches version pattern
const versionLabel = labels.find(l => /^v?\d+\.\d+\.\d+$/.test(l));

if (!versionLabel) {
core.setFailed('No version label found on merged PR');
return;
}

// Remove 'v' prefix if present
const version = versionLabel.replace(/^v/, '');
console.log(`Using version: ${version}`);
core.setOutput('version', version);

- name: Get current date
id: date
run: echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Update CHANGELOG
run: |
VERSION="${{ steps.version.outputs.version }}"
DATE="${{ steps.date.outputs.today }}"

# Check if unreleased section exists
if ! grep -q "## \[Unreleased\]" CHANGELOG.md; then
echo "Error: No [Unreleased] section found in CHANGELOG.md"
exit 1
fi

# Replace [Unreleased] with the version and date
sed -i.bak "s/## \[Unreleased\]/## [$VERSION] - $DATE/" CHANGELOG.md
rm CHANGELOG.md.bak

# Add new empty Unreleased section at the top
awk '/^## \[/ && !found {
print "## [Unreleased]\n"
found=1
}
{print}' CHANGELOG.md > CHANGELOG.tmp && mv CHANGELOG.tmp CHANGELOG.md

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Commit and push CHANGELOG changes
run: |
git add CHANGELOG.md

# Extract the release notes
release_notes=$(sed -n "/## \[${{ steps.version.outputs.version }}\]/,/## \[/p" CHANGELOG.md | sed '$d' | tail -n +2)

# Create commit message
cat > commit_msg.txt << EOF
chore: release v${{ steps.version.outputs.version }}

${release_notes}
EOF

git commit -F commit_msg.txt
git push origin main

- name: Fetch latest changes
run: git pull origin main

- name: Check if version already exists
run: |
if git rev-parse "${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
echo "Error: Tag ${{ steps.version.outputs.version }} already exists"
echo "This version has already been released"
exit 1
fi
if git ls-remote --heads origin "${{ steps.version.outputs.version }}" | grep -q "${{ steps.version.outputs.version }}"; then
echo "Error: Branch ${{ steps.version.outputs.version }} already exists"
exit 1
fi

- name: Create and push version tag
run: |
git tag ${{ steps.version.outputs.version }}
git push origin ${{ steps.version.outputs.version }}

- name: Create and push version branch
run: |
git checkout -b ${{ steps.version.outputs.version }}
git push origin ${{ steps.version.outputs.version }}

- name: Update latest tag
run: |
git checkout main
git tag -d latest 2>/dev/null || true
git push origin :refs/tags/latest 2>/dev/null || true
git tag latest
git push origin latest --force

- name: Summary
run: |
echo "### Release Created Successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Date**: ${{ steps.date.outputs.today }}" >> $GITHUB_STEP_SUMMARY
echo "- **PR**: #${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Created:**" >> $GITHUB_STEP_SUMMARY
echo "- Tag: \`${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Branch: \`${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Updated tag: \`latest\`" >> $GITHUB_STEP_SUMMARY
echo "- Updated CHANGELOG.md" >> $GITHUB_STEP_SUMMARY

# Job 3: Manual release creation (runs on workflow_dispatch)
create-release-manual:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Validate version format
run: |
if ! [[ "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Version must be in format X.Y.Z (e.g., 1.9.1)"
exit 1
fi

- name: Check if version already exists
run: |
if git rev-parse "${{ inputs.version }}" >/dev/null 2>&1; then
echo "Error: Tag ${{ inputs.version }} already exists"
echo "This version has already been released"
exit 1
fi
if git ls-remote --heads origin "${{ inputs.version }}" | grep -q "${{ inputs.version }}"; then
echo "Error: Branch ${{ inputs.version }} already exists"
exit 1
fi

- name: Get current date
id: date
run: echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Update CHANGELOG
run: |
VERSION="${{ inputs.version }}"
DATE="${{ steps.date.outputs.today }}"

# Check if unreleased section exists
if ! grep -q "## \[Unreleased\]" CHANGELOG.md; then
echo "Error: No [Unreleased] section found in CHANGELOG.md"
exit 1
fi

# Replace [Unreleased] with the version and date
sed -i.bak "s/## \[Unreleased\]/## [$VERSION] - $DATE/" CHANGELOG.md
rm CHANGELOG.md.bak

# Add new empty Unreleased section at the top
awk '/^## \[/ && !found {
print "## [Unreleased]\n"
found=1
}
{print}' CHANGELOG.md > CHANGELOG.tmp && mv CHANGELOG.tmp CHANGELOG.md

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Commit and push CHANGELOG changes
run: |
git add CHANGELOG.md

# Extract the release notes
release_notes=$(sed -n "/## \[${{ inputs.version }}\]/,/## \[/p" CHANGELOG.md | sed '$d' | tail -n +2)

# Create commit message
cat > commit_msg.txt << EOF
chore: release v${{ inputs.version }}

${release_notes}
EOF

git commit -F commit_msg.txt
git push origin ${{ inputs.branch }}

- name: Fetch latest changes
run: git pull origin ${{ inputs.branch }}

- name: Create and push version tag
run: |
git tag ${{ inputs.version }}
git push origin ${{ inputs.version }}

- name: Create and push version branch
run: |
git checkout -b ${{ inputs.version }}
git push origin ${{ inputs.version }}

- name: Update latest tag
run: |
git checkout ${{ inputs.branch }}
git tag -d latest 2>/dev/null || true
git push origin :refs/tags/latest 2>/dev/null || true
git tag latest
git push origin latest --force

- name: Summary
run: |
echo "### Release Created Successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Date**: ${{ steps.date.outputs.today }}" >> $GITHUB_STEP_SUMMARY
echo "- **Source Branch**: ${{ inputs.branch }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Created:**" >> $GITHUB_STEP_SUMMARY
echo "- Tag: \`${{ inputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Branch: \`${{ inputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Updated tag: \`latest\`" >> $GITHUB_STEP_SUMMARY
echo "- Updated CHANGELOG.md" >> $GITHUB_STEP_SUMMARY
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Add support to configure the traffic manager nginx through a configmap.
- Add **k8s/diagnose** documentation && new checks
- Fix **k8s/diagnose** checks, adding logs && improvements
- Add support for `NAMESPACE_OVERRIDE` configuration in k8s scope and deployment actions.
- Change delete cluster objects to maintain only one deployment_id per scope
- Do not execute actions that are not valid for current deployment status
- Upgrade libs versions in k8s/log/kube-logger-go

## [1.9.0] - 2025-12-17
- Add namespace validation and auto-creation
- Add deployment hints for failed deployments
Expand Down
Loading
Loading