Skip to content

Deploy: sync live web build + refuse to deploy an uncommitted dist/ - #53

Merged
sgardoll merged 5 commits into
mainfrom
feat/widget-conformance-rules
Aug 12, 2026
Merged

Deploy: sync live web build + refuse to deploy an uncommitted dist/#53
sgardoll merged 5 commits into
mainfrom
feat/widget-conformance-rules

Conversation

@sgardoll

Copy link
Copy Markdown
Owner

What

Two commits that get the repo back in agreement with the live site and stop the drift from recurring.

  1. build: rebuild dist to match deployed customcode.connectio.com.au — the deployed bundle (assets/index-BZ-fNYow.js) was sitting in the working tree uncommitted while main still pointed at assets/index-CqRheZeQ.js. main no longer reproduced what's actually live. This lands the deployed dist/ (index.html + the forced-add of the current hashed bundle, per the existing convention).
  2. fix: refuse to deploy an uncommitted dist/scripts/deploy_ftp.py now checks git status --porcelain -- dist/ and refuses to upload if the build isn't committed, so the web can never drift ahead of git again. --allow-dirty remains as an explicit emergency override.

Why it happened

The FTP mirror pushes whatever is in the on-disk dist/ — git is not involved. A build + deploy with no intervening commit put the live site ahead of the repo. Verified live: customcode.connectio.com.au serves index-BZ-fNYow.js with SHA-256 1f3a4fe9…cf0516, identical to the committed build.

Verified

  • Guard refuses a dirty dist/ (exit 1, no upload) and passes with --allow-dirty.
  • Committed dist bundle matches the live asset byte-for-byte.

Note: package.json/package-lock carry an uncommitted posthog-js ^1.353.0 → ^1.415.7 bump unrelated to this change — left out deliberately; decide separately.

🤖 Generated with Claude Code

sgardoll and others added 2 commits August 12, 2026 21:47
Co-Authored-By: Claude <noreply@anthropic.com>
The FTP mirror pushes whatever is on disk, so an uncommitted build was
silently putting the live site ahead of git (main pointed at the old
assets/index-CqRheZeQ.js while the web served index-BZ-fNYow.js). deploy_ftp.py
now verifies dist/ is clean against HEAD and refuses to upload otherwise,
keeping the deployed artifact reproducible from the repo. --allow-dirty
remains as an explicit emergency override.

Co-Authored-By: Claude <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR synchronizes the committed web build with the deployed site and strengthens FTP deployment validation so every uploaded artifact must exist at HEAD.

  • Replaces the deployed hashed JavaScript bundle and updates dist/index.html.
  • Commits the associated branding assets and PostHog dependency update.
  • Rejects dirty tracked artifacts and ignored build outputs absent from HEAD, with an explicit emergency override.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported ignored-artifact bypass is closed because every local upload path must now exist at HEAD before FTP activity begins, and no blocking failure remains.

Important Files Changed

Filename Overview
scripts/deploy_ftp.py Adds pre-upload checks for dirty tracked files and filesystem artifacts absent from HEAD, closing the previously reported ignored-artifact bypass.
dist/index.html Updates the entry script reference to the newly committed content-hashed bundle.
dist/assets/index-BZ-fNYow.js Commits the web bundle currently referenced by the synchronized deployment.
package.json Updates PostHog to the version represented by the committed deployed bundle.
package-lock.json Regenerates the dependency graph for the PostHog update.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start deployment] --> B{--allow-dirty?}
    B -- Yes --> F[Enumerate dist files]
    B -- No --> C{Tracked dist changes?}
    C -- Yes --> X[Refuse deployment]
    C -- No --> D[Enumerate files committed under dist]
    D --> E{Every local upload path exists at HEAD?}
    E -- No --> X
    E -- Yes --> F
    F --> G[Upload files over FTP]
    G --> H[Prune stale remote files]
Loading

Reviews (2): Last reviewed commit: "fix: guard the ignored dist/assets/ path..." | Re-trigger Greptile

Comment thread scripts/deploy_ftp.py Outdated
sgardoll and others added 2 commits August 12, 2026 21:56
Uncommitted dependency bump that shipped inside the deployed bundle; fold it in
so the repo fully reproduces the live build.

Co-Authored-By: Claude <noreply@anthropic.com>
The FTP uploader ships whatever is on disk, but git ignores dist/assets/.
A new content-hashed bundle there never appears in the porcelain status, so
the previous status-only check passed clean while the uncommitted file still
went over FTP. The guard now requires every file it will upload to exist at
HEAD, closing the gap between the filesystem artifact set and the committed one.

Co-Authored-By: Claude <noreply@anthropic.com>
@sgardoll

Copy link
Copy Markdown
Owner Author

@greptileai

The widget conformance rules ran only in validateBundleCompatibility, whose
findings land in bundle.metadata.compatibility - a presentation surface. Every
deploy path gates on validateFileMap -> validateDartFile, which never saw them,
so a widget with `required this.value` was labelled BLOCKING in the review and
deployed anyway.

The sibling rules added alongside these - the CustomAction return type and the
CodeFile name match - are wired into both places. The widget rules only got the
review half.

Adds getBlockingWidgetErrors() and calls it from validateDartFile for
CodeType.WIDGET, so all three deploy paths refuse the file. Errors only:
asset-without-anchor stays a warning and still deploys, since a broken image
path is a defect on device, not a file the project cannot compile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sgardoll
sgardoll merged commit cd5b624 into main Aug 12, 2026
2 of 3 checks passed
@sgardoll
sgardoll deleted the feat/widget-conformance-rules branch August 12, 2026 12:14
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