Skip to content

Bipelc/iran cafe foundation - #1637

Open
dichfrr wants to merge 2 commits into
FreeOpenSourcePOS:mainfrom
dichfrr:bipelc/iran-cafe-foundation
Open

dichfrr wants to merge 2 commits into
FreeOpenSourcePOS:mainfrom
dichfrr:bipelc/iran-cafe-foundation

Conversation

@dichfrr

@dichfrr dichfrr commented Nov 27, 2026

Copy link
Copy Markdown

Related work

Issue / Discussion:

Summary

Scope

Verification

Commands run:
Results:

Compatibility & data safety

  • Database/data impact: None / describe
  • Migration: None / describe
  • User-visible behavior: None / describe
  • Offline/network impact: None / describe

Screenshots

Cross-cutting surfaces

Surface Status
UI
API
Persistence
Upgrade path
CSV
Web print
Thermal print
LAN / server app
RTL
Dark mode
Timezone
Permissions

Developer documentation

  • No developer documentation change needed
  • Existing developer documentation updated:
  • New page justified:
  • Not applicable (docs-only or code-only change)

Contributor checklist

  • This is a small isolated fix/doc update OR follows an approved issue/direction.
  • Unrelated cleanups, refactors, and dependency changes were kept out of this PR.
  • Tests were added or updated for any behavior changes.
  • Verification commands were run and documented above.
  • Customer data and upgrade safety were preserved (if touching database/storage).
  • Documentation or translations were updated where relevant.
  • I understand and can explain all submitted changes.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Publish Bipelc Windows preview installers from branch pushes

⚙️ Configuration changes ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Add a branch-specific workflow to build a Windows x64 installer for Bipelc previews.
• Publish the installer and SHA-256 checksum as a GitHub prerelease with a production-use warning.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The workflow forms one bounded distribution capability: it builds, verifies, and publishes the Windows preview artifact.
  • Build and publication are producer and consumer hops of the same preview-release outcome, not independent application capabilities.
  • The workflow is branch-scoped and does not alter application runtime behavior.
Sources

.github/workflows/bipelc-windows-preview.yml[33-47]

      - name: Install dependencies
        run: npm ci
        env:
          CSC_IDENTITY_AUTO_DISCOVERY: false

      - name: Build desktop frontend
        run: npm run build:frontend
        env:
          NEXT_TELEMETRY_DISABLED: 1

      - name: Compile Electron main process
        run: npm run build

      - name: Package Windows NSIS installer
        run: npx electron-builder --win nsis --x64 --publish never

.github/workflows/bipelc-windows-preview.yml[65-90]

      - name: Publish GitHub preview release
        env:
          GH_TOKEN: ${{ github.token }}
          INSTALLER_PATH: ${{ steps.installer.outputs.path }}
          INSTALLER_NAME: ${{ steps.installer.outputs.name }}
          INSTALLER_SHA256: ${{ steps.installer.outputs.sha256 }}
        shell: bash
        run: |
          VERSION=$(node -p "require('./package.json').version")
          TAG="bipelc-v${VERSION}-preview.1"
          NOTES=$(mktemp)
          {
            echo "Windows desktop preview build for Bipelc."
            echo
            echo "- Installer: ${INSTALLER_NAME}"
            echo "- SHA-256: ${INSTALLER_SHA256}"
            echo "- Built from commit: ${GITHUB_SHA}"
            echo
            echo "This is an upstream FloCafe-based preview, not yet a customized production release for the Bipelc café. Review and test it before using it with real sales or customer data."
          } > "$NOTES"
          gh release create "$TAG" "$INSTALLER_PATH" release/SHA256SUMS.txt \
            --repo "$GITHUB_REPOSITORY" \
            --title "Bipelc Windows Preview ${VERSION}" \
            --notes-file "$NOTES" \
            --prerelease \
            --target "$GITHUB_SHA"
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before: no Bipelc-specific preview workflow existed.
  • After: a branch push drives dependency installation, two builds, Windows packaging, artifact selection, checksum output, and GitHub release creation.
  • The new correctness condition is that the installer selected by the PowerShell verification step, its emitted path/name/hash outputs, the checksum file, the version-derived tag, and the target commit remain consistent across the build-to-publication handoff.
  • The workflow also serializes runs through a shared concurrency group, so queued branch pushes must preserve the intended release behavior.
Sources

.github/workflows/bipelc-windows-preview.yml[33-47]

      - name: Install dependencies
        run: npm ci
        env:
          CSC_IDENTITY_AUTO_DISCOVERY: false

      - name: Build desktop frontend
        run: npm run build:frontend
        env:
          NEXT_TELEMETRY_DISABLED: 1

      - name: Compile Electron main process
        run: npm run build

      - name: Package Windows NSIS installer
        run: npx electron-builder --win nsis --x64 --publish never

.github/workflows/bipelc-windows-preview.yml[51-63]

      - name: Verify installer exists
        id: installer
        shell: pwsh
        run: |
          $installer = Get-ChildItem -Path release -Filter '*.exe' -File | Select-Object -First 1
          if (-not $installer) {
            throw 'Windows installer was not produced.'
          }
          $hash = (Get-FileHash -Path $installer.FullName -Algorithm SHA256).Hash.ToLower()
          "path=$($installer.FullName)" >> $env:GITHUB_OUTPUT
          "name=$($installer.Name)" >> $env:GITHUB_OUTPUT
          "sha256=$hash" >> $env:GITHUB_OUTPUT
          "SHA256 ($($installer.Name))  $hash" | Out-File -FilePath release/SHA256SUMS.txt -Encoding utf8

.github/workflows/bipelc-windows-preview.yml[65-90]

      - name: Publish GitHub preview release
        env:
          GH_TOKEN: ${{ github.token }}
          INSTALLER_PATH: ${{ steps.installer.outputs.path }}
          INSTALLER_NAME: ${{ steps.installer.outputs.name }}
          INSTALLER_SHA256: ${{ steps.installer.outputs.sha256 }}
        shell: bash
        run: |
          VERSION=$(node -p "require('./package.json').version")
          TAG="bipelc-v${VERSION}-preview.1"
          NOTES=$(mktemp)
          {
            echo "Windows desktop preview build for Bipelc."
            echo
            echo "- Installer: ${INSTALLER_NAME}"
            echo "- SHA-256: ${INSTALLER_SHA256}"
            echo "- Built from commit: ${GITHUB_SHA}"
            echo
            echo "This is an upstream FloCafe-based preview, not yet a customized production release for the Bipelc café. Review and test it before using it with real sales or customer data."
          } > "$NOTES"
          gh release create "$TAG" "$INSTALLER_PATH" release/SHA256SUMS.txt \
            --repo "$GITHUB_REPOSITORY" \
            --title "Bipelc Windows Preview ${VERSION}" \
            --notes-file "$NOTES" \
            --prerelease \
            --target "$GITHUB_SHA"

.github/workflows/bipelc-windows-preview.yml[11-13]

concurrency:
  group: bipelc-windows-preview
  cancel-in-progress: false
Potential damage 🟡 Medium 🩹 Temporary loss

  • If the changed workflow regresses, the Bipelc preview installer may not be built, verified, or published.
  • The supported source and existing application behavior remain available, and the workflow can be rerun or corrected.
  • If an incorrect artifact is published, republishing may be required; no evidence establishes impact to production releases or customer data.
  • A workflow failure is recoverable by correcting or reverting the workflow and rerunning the branch build.
  • A previously published incorrect artifact would require release replacement or republishing.
Sources

.github/workflows/bipelc-windows-preview.yml[33-47]

      - name: Install dependencies
        run: npm ci
        env:
          CSC_IDENTITY_AUTO_DISCOVERY: false

      - name: Build desktop frontend
        run: npm run build:frontend
        env:
          NEXT_TELEMETRY_DISABLED: 1

      - name: Compile Electron main process
        run: npm run build

      - name: Package Windows NSIS installer
        run: npx electron-builder --win nsis --x64 --publish never

.github/workflows/bipelc-windows-preview.yml[51-63]

      - name: Verify installer exists
        id: installer
        shell: pwsh
        run: |
          $installer = Get-ChildItem -Path release -Filter '*.exe' -File | Select-Object -First 1
          if (-not $installer) {
            throw 'Windows installer was not produced.'
          }
          $hash = (Get-FileHash -Path $installer.FullName -Algorithm SHA256).Hash.ToLower()
          "path=$($installer.FullName)" >> $env:GITHUB_OUTPUT
          "name=$($installer.Name)" >> $env:GITHUB_OUTPUT
          "sha256=$hash" >> $env:GITHUB_OUTPUT
          "SHA256 ($($installer.Name))  $hash" | Out-File -FilePath release/SHA256SUMS.txt -Encoding utf8

.github/workflows/bipelc-windows-preview.yml[65-90]

      - name: Publish GitHub preview release
        env:
          GH_TOKEN: ${{ github.token }}
          INSTALLER_PATH: ${{ steps.installer.outputs.path }}
          INSTALLER_NAME: ${{ steps.installer.outputs.name }}
          INSTALLER_SHA256: ${{ steps.installer.outputs.sha256 }}
        shell: bash
        run: |
          VERSION=$(node -p "require('./package.json').version")
          TAG="bipelc-v${VERSION}-preview.1"
          NOTES=$(mktemp)
          {
            echo "Windows desktop preview build for Bipelc."
            echo
            echo "- Installer: ${INSTALLER_NAME}"
            echo "- SHA-256: ${INSTALLER_SHA256}"
            echo "- Built from commit: ${GITHUB_SHA}"
            echo
            echo "This is an upstream FloCafe-based preview, not yet a customized production release for the Bipelc café. Review and test it before using it with real sales or customer data."
          } > "$NOTES"
          gh release create "$TAG" "$INSTALLER_PATH" release/SHA256SUMS.txt \
            --repo "$GITHUB_REPOSITORY" \
            --title "Bipelc Windows Preview ${VERSION}" \
            --notes-file "$NOTES" \
            --prerelease \
            --target "$GITHUB_SHA"
Assessed commit 2af6a39
Diagram

graph TD
  A["Branch push"] --> B["Preview workflow"] --> C["Frontend and Electron"] --> D["NSIS installer"] --> E["SHA-256 checksum"] --> F["GitHub prerelease"]
  D --> F
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Upload a GitHub Actions artifact instead
  • ➕ Avoids creating a release tag on every preview run.
  • ➕ Allows successive pushes at the same package version.
  • ➖ Less discoverable than a prerelease.
  • ➖ Artifacts have retention limits.
2. Reuse the production release workflow
  • ➕ Shares established release verification and packaging infrastructure.
  • ➖ Couples a branch preview to production tag, channel, and publication rules.

Recommendation: Keep the isolated workflow for a discoverable preview rather than relaxing production release rules. Before relying on push-based publishing, address the fixed preview tag: another push without a version change will cause gh release create to fail because the release already exists.

Files changed (1) +90 / -0

Other (1) +90 / -0
bipelc-windows-preview.ymlBuild and publish a branch-specific Windows preview +90/-0

Build and publish a branch-specific Windows preview

• Adds a Windows runner workflow triggered by pushes to the Bipelc branch. It installs dependencies with Node.js 22.22.1, builds the frontend and Electron process, packages an unsigned x64 NSIS installer, then publishes the installer and SHA-256 checksum as a GitHub prerelease with a production-use warning.

.github/workflows/bipelc-windows-preview.yml

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Later pushes cannot publish a preview 🐞 Bug ≡ Correctness
Description
TAG is derived only from the package version and the fixed preview.1 suffix, but every branch
push calls gh release create without handling an existing release. After the first successful
publication at a given version, subsequent pushes attempt to create the same tag and fail instead of
publishing their installers.
Code

.github/workflows/bipelc-windows-preview.yml[74]

+          TAG="bipelc-v${VERSION}-preview.1"
Evidence
The workflow runs on every push to the branch, while the current package version is 3.14.12. The
publication step always creates a release for the same version-derived tag and has no
existing-release branch.

.github/workflows/bipelc-windows-preview.yml[3-7]
.github/workflows/bipelc-windows-preview.yml[73-74]
.github/workflows/bipelc-windows-preview.yml[85-90]
package.json[1-4]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Every push at the same package version attempts to create the same preview release, so later builds cannot publish.
## Fix Focus Areas
- .github/workflows/bipelc-windows-preview.yml[73-74]
- .github/workflows/bipelc-windows-preview.yml[85-90]
## Recommended Fix
Derive a unique preview tag from the triggering commit or another monotonic build identifier. Keep the release title and notes consistent with that identity, and make reruns of the same commit handle an already-created release safely.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Preview users receive upstream updates 🐞 Bug ≡ Correctness
Description
The installer retains package.json’s FloCafe GitHub update provider and stable package version,
while this workflow publishes its preview to the triggering repository without updater metadata.
When an installed preview checks for updates, it uses the upstream stable feed rather than a Bipelc
preview feed, so a newer upstream build can be offered in place of a preview update.
Code

.github/workflows/bipelc-windows-preview.yml[85]

+          gh release create "$TAG" "$INSTALLER_PATH" release/SHA256SUMS.txt \
Evidence
The packaged configuration points to FreeOpenSourcePOS/FloCafe on the latest channel, and the
running app configures and checks its updater. This workflow instead uploads only the installer and
checksum to its own GitHub release; the existing Windows release workflow explicitly requires a
channel manifest and blockmap for updates.

package.json[1-4]
package.json[474-491]
main/index.ts[234-245]
main/index.ts[267-279]
main/update-channel.ts[24-38]
.github/workflows/bipelc-windows-preview.yml[65-90]
.github/workflows/release.yml[768-776]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Installed preview builds use the upstream stable update feed rather than the repository and releases that publish these previews.
## Fix Focus Areas
- .github/workflows/bipelc-windows-preview.yml[46-49]
- .github/workflows/bipelc-windows-preview.yml[73-90]
- package.json[474-491]
## Recommended Fix
Give preview builds an explicit update policy. Either package them with an isolated preview provider and version/channel and publish the matching installer metadata and blockmap to that feed, or disable in-app updates for preview builds and document manual replacement.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: Auto: ⚖️ Balanced: CI release automation and write permissions require careful security-sensitive review.

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

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.

1 participant