Skip to content

Conversation

tadiwa-aizen
Copy link
Contributor

What changed and why?
This PR adds a new GitHub Actions workflow that automatically tests RPM package builds for Amazon Linux 2023. The workflow creates both source and binary RPMs using mock in a clean AL2023 container environment, then validates the installation and basic functionality of the mount-s3 package. It includes end-to-end testing by actually mounting an S3 bucket and performing file operations to ensure the RPM works correctly. This ensures that RPM packages built for Amazon Linux 2023 are properly tested in CI before release, catching any packaging or compatibility issues early.

Does this change impact existing behavior?

Added more tests, for al2023 build compatibility

Does this change need a changelog entry? Does it require a version change?

No, just CI tests for al2023 intergration


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
@tadiwa-aizen tadiwa-aizen temporarily deployed to PR integration tests October 7, 2025 21:21 — with GitHub Actions Inactive
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
@tadiwa-aizen tadiwa-aizen requested a deployment to PR integration tests October 8, 2025 08:24 — with GitHub Actions Waiting
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
S3_REGION: ${{ vars.S3_REGION }}

permissions:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: can we move these above the env section?

cd $GITHUB_WORKSPACE
cd package
python3 generate_spec.py amzn2023
ls -la amzn2023-packaging.spec
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this here?

- name: Generate Amazon Linux 2023 spec file
run: |
cd $GITHUB_WORKSPACE
Copy link
Contributor

Choose a reason for hiding this comment

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

We can merge the cd commands

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, there should be quotes surrounding usage of environment variables

run: |
cd $GITHUB_WORKSPACE
echo " Extracting version from spec file..."
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this many echo statements?

cp package/amzn2023-packaging.spec ~/rpmbuild/SPECS/
cp LICENSE ~/rpmbuild/SOURCES/
Copy link
Contributor

Choose a reason for hiding this comment

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

These can all be merged together

cp THIRD_PARTY_LICENSES ~/rpmbuild/SOURCES/
echo "RPM Sources created"
echo " Creating source tarball..."
Copy link
Contributor

Choose a reason for hiding this comment

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

This dance here is confusing - it's not obvious where our cwd is at any given point

run: |
# https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6
echo "y" | dnf install sudo
chmod 0400 /etc/shadow || true
Copy link
Contributor

Choose a reason for hiding this comment

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

Why || true?

- name: Avoid PAM issues by installing sudo interactively
run: |
# https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6
echo "y" | dnf install sudo
Copy link
Contributor

Choose a reason for hiding this comment

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

dnf install -y

run: |
echo " Building binary RPM for version: $VERSION"
sudo mock -r amazonlinux-2023-x86_64 --clean
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to run clean before the initial build?

Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
@tadiwa-aizen tadiwa-aizen temporarily deployed to PR integration tests October 8, 2025 19:20 — with GitHub Actions Inactive
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
name: AL2023 RPM Build Tests

on:
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we remove pull_request_target?

run: |
mkdir -p /mnt/s3-test
TEST_PREFIX="github-actions-tmp/run-${{ github.run_id }}/rpm-test/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not make this part of the Github environment at the top?

Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
@muddyfish
Copy link
Contributor

Can you send an actions link to where it's passed in the most recent commit?


- name: Generate Amazon Linux 2023 spec file
run: |
python3 package/generate_spec.py amzn2023
Copy link
Contributor

Choose a reason for hiding this comment

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

Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
Signed-off-by: Tadiwa Magwenzi <tadiwaom@amazon.com>
- name: Generate Amazon Linux 2023 spec file
run: |
cd package
uv run python generate_spec.py amzn2023 && mv amzn2023.spec ../
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to move the output file rather than including an argument for where to write it in the first place?


- name: Generate Amazon Linux 2023 spec file
run: |
cd package
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to use cd here?

run: |
cd package
uv run python generate_spec.py amzn2023 && mv amzn2023.spec ../
echo "## Generated Amazon Linux 2023 Spec File" >> $GITHUB_STEP_SUMMARY
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way of doing a multi-line echo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@muddyfish There are 3 ways of doing that, im not sure which one you meant?

1. Heredoc

cat << 'EOF' >> $GITHUB_STEP_SUMMARY
## Generated Amazon Linux 2023 Spec File

```spec
EOF
cat ../amzn2023.spec >> $GITHUB_STEP_SUMMARY
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
```
EOF

2. Multiline echo

echo -e "## Generated Amazon Linux 2023 Spec File\n\n\`\`\`spec" >> $GITHUB_STEP_SUMMARY
cat ../amzn2023.spec >> $GITHUB_STEP_SUMMARY
echo -e "\n\`\`\`" >> $GITHUB_STEP_SUMMARY

3. Command grouping

{
    echo "## Generated Amazon Linux 2023 Spec File"
    echo ""
    echo '```spec'
    cat ../amzn2023.spec
    echo ""
    echo '```'
} >> $GITHUB_STEP_SUMMARY

Copy link
Contributor

@muddyfish muddyfish Oct 14, 2025

Choose a reason for hiding this comment

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

Can we do something like $(cat ../amzn2023.spec)? If so, adding that to the option 1 sounds best

Comment on lines +32 to +33
- name: Install uv
uses: astral-sh/setup-uv@v6
Copy link
Contributor

Choose a reason for hiding this comment

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

If you push another rev, can you bump this to V7?

rel: #1649

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants