Skip to content

fix: simplify Forge AWS deploy to branch and slot - #16251

Merged
jamesfredley merged 1 commit into
7.2.xfrom
fix/forge-aws-workflow-simple-7.2
Aug 28, 2026
Merged

jamesfredley merged 1 commit into
7.2.xfrom
fix/forge-aws-workflow-simple-7.2

Conversation

@jamesfredley

Copy link
Copy Markdown
Contributor

Description

Simplify Forge AWS deploy to branch + slot.

  • Remove source_ref, release, stack, and region inputs. Use the branch from Use workflow from.
  • Hard-code us-east-1 and grails-forge-shared.
  • Package only (awsElasticBeanstalk); do not run Forge tests on deploy.
  • Grant cloudformation:GetTemplate so Elastic Beanstalk UpdateEnvironment works.
  • Stop re-declaring com.gradleup.shadow (it is already on the Micronaut classpath).

Keep only the slot input. Build the branch selected in Use workflow from.
Hard-code region and stack name. Package without running Forge tests.
Give the deploy role cloudformation:GetTemplate so UpdateEnvironment works.
Stop re-declaring the Shadow plugin; configure shadowJar when Micronaut applies it.
Copilot AI lite review requested due to automatic review settings August 28, 2026 17:17
@jamesfredley
jamesfredley merged commit 9d92ce1 into 7.2.x Aug 28, 2026
49 of 50 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Simplifies the Forge AWS Elastic Beanstalk deploy workflow to deploy based on the chosen workflow branch (“Use workflow from”) plus a slot, removing several previously user-provided inputs and reducing deploy-time work.

Changes:

  • Simplifies workflow_dispatch inputs and hard-codes shared stack + region; packages only (no tests).
  • Adjusts IAM permissions to support Elastic Beanstalk environment updates that require CloudFormation template access.
  • Makes ShadowJar reproducibility configuration resilient to either Shadow plugin id.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
grails-forge/infrastructure/shared.yaml Expands CloudFormation permissions to support EB update flow.
grails-forge/grails-forge-web-netty/build.gradle Updates ShadowJar configuration and AWS EB packaging task wiring.
grails-forge/docs/aws-elastic-beanstalk.md Updates deployment docs to match branch+slot dispatch model.
.github/workflows/forge-deploy-aws.yml Simplifies deployment workflow inputs, packaging steps, and deploy/rollback script.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +121 to +124
if [[ -z "${DEPLOY_ROLE_ARN}" ]]; then
echo "AWS_FORGE_DEPLOY_ROLE_ARN must be configured as a repository variable." >&2
exit 1
fi
# reads javaVersion from gradle.properties. OIDC trusts refs/heads/*.x and
# refs/tags/v* in apache/grails-core, so new version branches need no template edit.
# Dispatch from the maintenance branch that should be built (Use workflow from).
# Choose the slot. Region, stack name, and JDK come from that branch.
elif [[ "${update_started}" == true ]]; then
echo "Deployment failed, but no prior application version is available for rollback." >&2
echo "Deployment failed. Rolling back ${ENVIRONMENT_NAME}."
aws elasticbeanstalk update-environment --environment-name "${ENVIRONMENT_NAME}" --version-label "${previous_version}" >/dev/null || true
Comment on lines 85 to +86
TaskProvider<Zip> awsElasticBeanstalk = tasks.register('awsElasticBeanstalk', Zip) {
dependsOn(shadowJarTask)
dependsOn('shadowJar')
Comment on lines +92 to 94
from({ tasks.named('shadowJar').get().archiveFile.get() }) {
rename { 'app.jar' }
}
Comment on lines +76 to +82
['com.gradleup.shadow', 'com.github.johnrengelman.shadow'].each { pluginId ->
pluginManager.withPlugin(pluginId) {
tasks.named('shadowJar', ShadowJar).configure {
reproducibleFileOrder = true
preserveFileTimestamps = false
}
}
Comment on lines +278 to 283
- Action:
- cloudformation:DescribeStacks
- cloudformation:DescribeStackResources
- cloudformation:GetTemplate
Effect: Allow
Resource: '*'
@jamesfredley
jamesfredley deleted the fix/forge-aws-workflow-simple-7.2 branch August 28, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants