Skip to content

Conversation

@lidaobing
Copy link
Member

@lidaobing lidaobing commented Jan 25, 2026

Summary by Sourcery

Add a GitHub Actions workflow to build and publish Flatpak snapshot builds from a dedicated branch to GitHub Pages.

CI:

  • Introduce a Flatpak snapshot workflow that builds on the flatpak-snapshot branch and runs Flatpak/SDK setup and build steps in CI.

Deployment:

  • Publish the built Flatpak repository to the gh-pages branch using an automated deployment step.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 25, 2026

Reviewer's Guide

Adds a new GitHub Actions workflow to build a Flatpak snapshot for the project on a dedicated branch and deploy the resulting Flatpak repository to GitHub Pages.

Sequence diagram for Flatpak snapshot CI/CD pipeline

sequenceDiagram
  actor Developer
  participant GitHub
  participant Workflow as FlatpakSnapshotWorkflow
  participant Runner as GitHubActionsRunner
  participant FlatpakBuilder
  participant Pages as GitHubPages

  Developer->>GitHub: Push to branch flatpak-snapshot
  GitHub-->>Workflow: Trigger workflow on push or manual dispatch
  Workflow->>Runner: Start build-and-deploy job
  Runner->>GitHub: Checkout repository
  Runner->>Runner: Install Flatpak and dependencies
  Runner->>Runner: Install GNOME SDK and Platform runtimes
  Runner->>Runner: Compute VERSION from git short hash and set env
  Runner->>FlatpakBuilder: Run flatpak-builder to build Flatpak into build-dir
  FlatpakBuilder-->>Runner: Build output in build-dir
  Runner->>FlatpakBuilder: Export Flatpak repo to repo directory
  FlatpakBuilder-->>Runner: Flatpak repository in repo
  Runner->>GitHub: Commit and push repo directory to gh-pages branch
  GitHub-->>Pages: Update published site with new Flatpak repo
  Developer-->>Pages: Access updated Flatpak snapshot via GitHub Pages
Loading

Flow diagram for Flatpak snapshot build-and-deploy job

flowchart TD
  A[Start build-and-deploy job] --> B[Checkout repository actions/checkout@v4]
  B --> C[Install Flatpak and dependencies via apt]
  C --> D[Install GNOME SDK and Platform runtimes from Flathub]
  D --> E[Set snapshot version from git rev-parse --short HEAD and export VERSION env]
  E --> F[Build Flatpak with flatpak-builder using iptux.flatpak.yaml into build-dir]
  F --> G[Export Flatpak repository from build-dir to repo with collection id io.github.iptux]
  G --> H[Deploy repo directory to gh-pages branch using actions-gh-pages]
  H --> I[End job with updated Flatpak snapshot on GitHub Pages]
Loading

File-Level Changes

Change Details Files
Introduce a GitHub Actions workflow that builds a Flatpak snapshot from the repository and publishes it to GitHub Pages when triggered.
  • Configure workflow triggers for pushes to the flatpak-snapshot branch and manual workflow_dispatch runs.
  • Set up Flatpak and required build tooling on ubuntu-latest, including installing the GNOME SDK and Platform runtimes from Flathub.
  • Derive a snapshot version from the current Git commit hash and expose it via the GITHUB_ENV environment.
  • Build the Flatpak using flatpak-builder against the iptux.flatpak.yaml manifest and export the result to a Flatpak repository directory.
  • Deploy the generated Flatpak repository from the repo directory to the gh-pages branch using peaceiris/actions-gh-pages with an automated commit message including the snapshot version.
.github/workflows/flatpak-snapshot.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • Consider pinning the GitHub Actions you use (e.g., actions/checkout@v4, peaceiris/actions-gh-pages@v4) to specific commit SHAs to avoid unexpected behavior changes when those actions are updated.
  • The workflow installs Flatpak and the GNOME SDK from scratch on every run; you might want to introduce caching (e.g., for flatpak-builder downloads or the build-dir/runtime) or use a dedicated Flatpak setup action to reduce build time and resource usage.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider pinning the GitHub Actions you use (e.g., `actions/checkout@v4`, `peaceiris/actions-gh-pages@v4`) to specific commit SHAs to avoid unexpected behavior changes when those actions are updated.
- The workflow installs Flatpak and the GNOME SDK from scratch on every run; you might want to introduce caching (e.g., for `flatpak-builder` downloads or the `build-dir`/runtime) or use a dedicated Flatpak setup action to reduce build time and resource usage.

## Individual Comments

### Comment 1
<location> `.github/workflows/flatpak-snapshot.yml:16-17` </location>
<code_context>
+      contents: write
+    steps:
+      # 1. Checkout repo
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      # 2. Set up Flatpak
</code_context>

<issue_to_address>
**🚨 suggestion (security):** Consider pinning GitHub Actions to specific commit SHAs for supply-chain security

Floating tags like `@v4` can change over time and introduce supply-chain risk. Please pin `actions/checkout` (and other third-party actions in this workflow) to a specific commit SHA, with an inline comment noting the version for traceability.

Suggested implementation:

```
      # 1. Checkout repo
      - name: Checkout
        # v4.2.2
        uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633

```

If there are other third-party actions used elsewhere in this workflow file (or in other workflow files), they should also be updated to use commit SHA pins with inline comments indicating the tagged version (e.g., `# vX.Y.Z`) for consistency and supply-chain security.
</issue_to_address>

### Comment 2
<location> `.github/workflows/flatpak-snapshot.yml:40-42` </location>
<code_context>
+          echo "Snapshot version set to ${VERSION}"
+
+      # 5. Build Flatpak
+      - name: Build Flatpak
+        run: |
+          flatpak-builder --force-clean build-dir iptux.flatpak.yaml
+
+      # 6. Export repository to repo/
</code_context>

<issue_to_address>
**suggestion:** Consider wiring the computed VERSION into the Flatpak build to keep metadata consistent

Right now `VERSION` (from the Git hash) is only used in the commit message. If `iptux.flatpak.yaml` defines a version or relies on `--env`/`--default-branch`, consider passing `${{ env.VERSION }}` into the Flatpak build so the Flatpak metadata matches the snapshot version instead of just the GitHub Pages commit.

Suggested implementation:

```
      # 5. Build Flatpak
      - name: Build Flatpak
        env:
          VERSION: ${{ env.VERSION }}
        run: |
          flatpak-builder --force-clean build-dir iptux.flatpak.yaml

```

If `iptux.flatpak.yaml` does not yet reference the `VERSION` environment variable, you may also want to:
1. Add `${VERSION}` in the manifest’s `app-id`, `branch`, or `metadata` (e.g. `version: ${VERSION}`) as appropriate.
2. Optionally, if you prefer using Flatpak’s CLI flags instead of env substitution, you could additionally change the run command to include flags like `--default-branch=${VERSION}` or `--env=VERSION=${VERSION}`, depending on how your manifest is structured.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +16 to +17
- name: Checkout
uses: actions/checkout@v4
Copy link

Choose a reason for hiding this comment

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

🚨 suggestion (security): Consider pinning GitHub Actions to specific commit SHAs for supply-chain security

Floating tags like @v4 can change over time and introduce supply-chain risk. Please pin actions/checkout (and other third-party actions in this workflow) to a specific commit SHA, with an inline comment noting the version for traceability.

Suggested implementation:

      # 1. Checkout repo
      - name: Checkout
        # v4.2.2
        uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633

If there are other third-party actions used elsewhere in this workflow file (or in other workflow files), they should also be updated to use commit SHA pins with inline comments indicating the tagged version (e.g., # vX.Y.Z) for consistency and supply-chain security.

Comment on lines 40 to 42
- name: Build Flatpak
run: |
flatpak-builder --force-clean build-dir iptux.flatpak.yaml
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider wiring the computed VERSION into the Flatpak build to keep metadata consistent

Right now VERSION (from the Git hash) is only used in the commit message. If iptux.flatpak.yaml defines a version or relies on --env/--default-branch, consider passing ${{ env.VERSION }} into the Flatpak build so the Flatpak metadata matches the snapshot version instead of just the GitHub Pages commit.

Suggested implementation:

      # 5. Build Flatpak
      - name: Build Flatpak
        env:
          VERSION: ${{ env.VERSION }}
        run: |
          flatpak-builder --force-clean build-dir iptux.flatpak.yaml

If iptux.flatpak.yaml does not yet reference the VERSION environment variable, you may also want to:

  1. Add ${VERSION} in the manifest’s app-id, branch, or metadata (e.g. version: ${VERSION}) as appropriate.
  2. Optionally, if you prefer using Flatpak’s CLI flags instead of env substitution, you could additionally change the run command to include flags like --default-branch=${VERSION} or --env=VERSION=${VERSION}, depending on how your manifest is structured.

@github-actions
Copy link

github-actions bot commented Jan 25, 2026

Test Results

69 tests  ±0   69 ✅ ±0   5s ⏱️ +2s
32 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 3f0c134. ± Comparison against base commit e5ebeed.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.99%. Comparing base (e5ebeed) to head (3f0c134).

Files with missing lines Patch % Lines
src/iptux/LogSystem.cpp 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #708      +/-   ##
==========================================
- Coverage   52.01%   51.99%   -0.03%     
==========================================
  Files          64       64              
  Lines        8599     8601       +2     
==========================================
- Hits         4473     4472       -1     
- Misses       4126     4129       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants