-
Notifications
You must be signed in to change notification settings - Fork 188
Description
AL-Go Bug Report: Create Release workflow violates GitHub release patterns and creates misleading user experience
AL-Go version
v8.2
Describe the issue
The "Create release" workflow (CreateRelease.yaml) follows an unconventional and confusing release pattern that violates standard GitHub release workflows. Instead of building current code and creating a release from it, the workflow packages already-built artifacts from a previous CI/CD run into a GitHub release. This creates a misleading user experience and breaks expected release semantics.
Why this is a problem
1. Violates standard release workflow pattern
Standard GitHub release pattern:
- User triggers "Create release" workflow
- Workflow checks out current code
- Workflow builds the code
- Workflow creates Git tag
- Workflow creates GitHub release from the tag
- Workflow attaches build artifacts to the release
AL-Go "Create release" pattern:
- User triggers "Create release" workflow
- Workflow does not build anything
- Workflow fetches artifacts from a previous CI/CD run (possibly from different code/commit)
- Workflow creates Git tag on current commit (not the commit that built the artifacts)
- Workflow creates GitHub release
- Workflow attaches old artifacts (from different commit) to release
- Workflow optionally creates release branch (after creating release - backwards)
- Workflow optionally increments version number (after creating release - backwards)
This violates user expectations and creates tag/artifact mismatches.
2. Tag and artifact mismatch
Example scenario:
- Commit A (2 days ago): Developer builds app v1.0.100
- Commit B (1 day ago): Developer fixes critical bug, does NOT run CI/CD
- Commit C (today): Developer triggers "Create release" workflow
- Inputs: tag=v1.0.100, buildVersion=latest
- Workflow creates tag
v1.0.100on commit C - Workflow attaches artifacts from commit A (2 days old)
- Release tag points to commit C (which has the bug fix)
- Release artifacts are from commit A (without the bug fix)
Result: The release is invalid. The tag and artifacts don't match. Users who download the release get old code that doesn't correspond to the tagged commit.
3. "Create release" doesn't create a release from current code
When users click "Create release", they expect to release current code. AL-Go's workflow instead releases old artifacts. This is fundamentally misleading.
User expectation:
- "I want to release the code I just committed"
- Triggers "Create release" workflow
- Expects current code to be built and released
AL-Go actual behavior:
- Workflow finds most recent CI/CD artifacts (could be from any commit)
- Packages those old artifacts
- Tags current commit (mismatch!)
- User believes they released current code, but actually released old code
4. Workflow operations happen in backwards order
The workflow performs operations in the wrong sequence:
Current order (wrong):
- Create release
- Create release branch (optional)
- Increment version number (optional)
Correct order:
- Increment version number (if requested)
- Create release branch (if requested)
- Build code from release branch
- Create release with fresh build artifacts
Creating the release branch after the release defeats the purpose of release branches. Release branches exist to isolate release code from ongoing development. Creating them after the release is already published makes no sense.
5. Deprecated GitHub API usage
Line 173 in CreateRelease.yaml:
make_latest: 'legacy'This uses deprecated GitHub API behavior. Modern GitHub releases should use:
make_latest: truefor production releasesmake_latest: falsefor pre-releases/drafts
The 'legacy' mode exists only for backwards compatibility and should not be used in new workflows.
6. Confusing input parameters
From CreateRelease.yaml lines 10-13:
inputs:
buildVersion:
description: Build version to promote to release (default is latest)
required: false
default: 'latest'The phrase "promote to release" suggests this is a promotion workflow, not a release creation workflow. It implies artifacts are being promoted from one environment to another, which is not how GitHub releases work.
Users must understand that:
buildVersion: latestmeans "find the most recent CI/CD run and package those artifacts"- The artifacts may be from a completely different branch/commit/date
- The workflow does not build anything
This is unintuitive and error-prone.
Steps to reproduce
Setup
- Create AL-Go for GitHub AppSource repository (v8.2)
- Make initial commit with AL code
- Trigger CI/CD workflow to build artifacts
- Create new commit with additional changes (do NOT run CI/CD)
Reproduce tag/artifact mismatch
- Go to GitHub Actions
- Trigger "Create release" workflow manually
- Provide inputs:
- name: "Release 1.0.0"
- tag: "v1.0.0"
- buildVersion: "latest"
- releaseType: "Release"
- Wait for workflow to complete
- Check the created release
Expected:
- Tag
v1.0.0points to current commit (latest code) - Release artifacts contain builds of current commit (latest code)
- Tag and artifacts match
Actual:
- Tag
v1.0.0points to current commit (latest code) - Release artifacts are from previous CI/CD run (old code, different commit)
- Tag and artifacts do not match
Reproduce confusing workflow order
- Trigger "Create release" with:
- createReleaseBranch: true
- updateVersionNumber: "+0.1"
- Observe workflow execution order:
- CreateRelease job runs first
- Release is created and published
- CreateReleaseBranch job runs second
- Release branch is created after release is public
Expected: Release branch should exist before release is published
Actual: Release branch is created after release is published (backwards)
Expected behavior
Recommended design: Standard release workflow
The "Create release" workflow should follow GitHub's standard release pattern:
name: Create Release
on:
workflow_dispatch:
inputs:
name:
description: Release name
required: true
tag:
description: Release tag (semver)
required: true
releaseType:
description: Release type
type: choice
options:
- Release
- Prerelease
- Draft
jobs:
CreateRelease:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Create release branch first (if needed)
- name: Create release branch
run: |
git checkout -b release/${{ inputs.tag }}
git push origin release/${{ inputs.tag }}
# Build code from release branch
- name: Build
uses: ./.github/workflows/_BuildALGoProject.yaml
# ... build all projects
# Create Git tag
- name: Create tag
run: |
git tag ${{ inputs.tag }}
git push origin ${{ inputs.tag }}
# Create GitHub release
- name: Create release
uses: actions/github-script@v7
with:
script: |
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ inputs.tag }}',
name: '${{ inputs.name }}',
draft: ${{ inputs.releaseType == 'Draft' }},
prerelease: ${{ inputs.releaseType == 'Prerelease' }},
make_latest: true # NOT 'legacy'
});
# Upload build artifacts
- name: Upload artifacts
# ... upload artifacts that were just builtKey differences from current AL-Go implementation:
- Builds current code instead of packaging old artifacts
- Creates release branch first (if requested) instead of after
- Tags the commit being released instead of arbitrary current commit
- Uses modern GitHub API (
make_latest: true) instead of deprecated'legacy' - Tag and artifacts always match because both come from same build
Alternative: Rename to "Promote Build to Release"
If AL-Go's current design is intentional (packaging previous builds), the workflow should be renamed to reflect its actual behavior:
- Current name: "Create release" (misleading)
- Accurate name: "Promote build to release" or "Package existing build"
And the workflow description should clearly state:
"This workflow packages artifacts from a previous CI/CD run into a GitHub release. It does NOT build new code. Use 'buildVersion' input to select which CI/CD run to package."
Actual behavior
Current workflow execution flow
CreateRelease.yaml workflow:
-
Lines 132-140:
DetermineArtifactsForReleaseaction- Queries GitHub Actions for workflow runs
- Finds artifacts from previous CI/CD run matching
buildVersioninput - Returns artifact download URLs
- Does not build anything
-
Lines 142-149:
CreateReleaseNotesaction- Generates release notes from Git commits
- Commits may not match artifact commits (mismatch!)
-
Lines 151-180: Create GitHub release
- Creates tag on current commit
- Attaches artifacts from different commit
- Uses deprecated
make_latest: 'legacy'
-
Lines 181-266:
UploadArtifactsjob- Downloads artifacts from previous workflow run
- Uploads to GitHub release
- Artifacts are from old commit, tag is on new commit
-
Lines 268-289:
CreateReleaseBranchjob (optional)- Creates release branch after release is published
- Branch creation happens backwards
-
Lines 291-320:
UpdateVersionNumberjob (optional)- Increments version after release is published
- Version increment happens backwards
Impact on users
Scenario 1: Accidental release of old code
Timeline:
- Monday: Developer commits feature A, runs CI/CD
- Tuesday: Developer commits critical bug fix, forgets to run CI/CD
- Wednesday: Developer triggers "Create release" → Releases Monday's code without the bug fix
- Customer downloads release, encounters bug that was supposedly fixed
- Team loses customer confidence
Scenario 2: Release branch confusion
Timeline:
- Developer triggers "Create release" with
createReleaseBranch: true - GitHub release is published immediately
- Customers start downloading and deploying
- Release branch is created 5 minutes later (after release is public)
- Developer attempts to make hotfix to release branch
- Realizes release branch was created AFTER release was published
- Release branch doesn't serve its purpose
Scenario 3: Tag/artifact forensics nightmare
Timeline:
- Team releases v1.0.100 using AL-Go workflow
- Customer reports bug in v1.0.100
- Developer checks out tag
v1.0.100to investigate - Developer cannot reproduce bug
- Developer downloads release artifacts
- Artifacts contain different code than tag
- Developer spends hours debugging mismatch
- Discovers tag and artifacts are from different commits
Additional context
How other CI/CD systems handle releases
GitHub Actions (standard pattern):
- Build, then tag, then release
- Tag and artifacts always match
- Release workflow builds current code
Azure DevOps:
- Build pipeline creates artifacts
- Release pipeline deploys artifacts
- Clear separation: "Build" vs "Release" (AL-Go conflates these)
GitLab CI/CD:
- Build job runs first
- Release job depends on build job
- Release uses artifacts from same pipeline run
AL-Go:
- No build in release workflow
- Packages artifacts from arbitrary previous run
- Tag and artifacts can diverge
Why the current design is problematic for AppSource
AL-Go is designed for AppSource app development. AppSource apps must pass Microsoft validation. The current release workflow creates these problems:
-
Validation mismatch: If developer submits release artifacts to AppSource, but those artifacts don't match the release tag, Microsoft validation may flag inconsistencies
-
Source code requirements: AppSource requires source code matching submitted binaries. If release tag and artifacts don't match, source code won't match either
-
Hotfix challenges: If customer finds bug in released version, developer checks out release tag, fixes bug, but cannot easily create patched release because workflow doesn't build from tags
Suggested fixes
Option 1: Complete redesign (recommended)
Redesign "Create release" workflow to follow standard GitHub release pattern:
- Build current code
- Create tag
- Create release
- Upload fresh build artifacts
Option 2: Rename and document (minimal fix)
Keep current design but:
- Rename workflow to "Promote build to release"
- Add prominent documentation explaining it doesn't build code
- Add validation to prevent tag/artifact mismatches
- Fix operation order (create branch BEFORE release, increment version BEFORE release)
- Replace
make_latest: 'legacy'withmake_latest: true
Option 3: Hybrid approach
Provide two workflows:
- "Create release from current code" - builds and releases current commit
- "Promote build to release" - packages existing artifacts (current AL-Go behavior)
Let users choose appropriate workflow for their scenario.
Related issues
This issue relates to broader AL-Go workflow design concerns:
- Workflow input logging (separate issue)
- False positive SUCCESS reporting (issue [Bug]: Publish To Environment workflow does not log user inputs and reports false success when environments are skipped #2147)
- Workflow name inconsistencies (separate issue)
All stem from AL-Go workflows not following GitHub/industry conventions for CI/CD automation.