Repository navigation
Deploy the proxy from ontola/atomic-plugins via a thin atomic-integration-proxy wrapper - #77
Merged
Conversation
The proxy now lives in ontola/atomic-plugins' integration-proxy/ as the library crate `atomic-integration-proxy` (ontola/atomic-plugins#81). This repository keeps only the Heroku deployment wrapper from that repo's integration-proxy/examples/heroku-wrapper/: a one-line main calling `atomic_integration_proxy::run()`, the `auth-proxy` package/binary name and the unchanged Procfile. The crate is not on crates.io yet, so it is a git dependency pinned to ontola/atomic-plugins 494eb8af139b60a41e5197c92053890c0d841b2f; switch to `version = "0.1"` once it is published. Cargo.lock was seeded from the crate's own lockfile, so every third-party dependency resolves to the same version as the previous Cargo.lock here. ontola/atomic-plugins main contains this repository's main (c02b5e5) in its history; the source there differs only by changes made since the move. CI now only checks formatting, clippy, a locked release build, and that the unconfigured binary exits with a configuration error; the proxy's tests run in ontola/atomic-plugins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The proxy's source now lives in
ontola/atomic-plugins/integration-proxyas the library crateatomic-integration-proxy(ontola/atomic-plugins#81). This PR removes the copy of it here and leaves only the Heroku deployment wrapper, taken from that repo'sintegration-proxy/examples/heroku-wrapper/:src/main.rs:atomic_integration_proxy::run().await, nothing else.Cargo.toml: the package and binary are still namedauth-proxy, so the Procfile (web: target/release/auth-proxy) is unchanged. The crate isn't on crates.io yet, so the dependency is a git dependency pinned toontola/atomic-plugins@494eb8af139b60a41e5197c92053890c0d841b2f(currentmain). Cargo finds the package in theintegration-proxy/subdirectory by its name. A comment says to switch toversion = "0.1"once the crate is published.Cargo.lock: seeded from the crate's own lockfile. Every third-party dependency resolves to the same version as the previousCargo.lockhere. The only new entry isatomic-integration-proxyitself.rust-toolchain:stable, which is whatemk/heroku-buildpack-rustalready used by default when no such file existed.src/*(apart frommain.rs),static/,tests/,rustfmt.toml,AGENTS.md,SECURITY.mdandTESTING_COVERAGE.md. Kept:LICENSE,.env.example(identical to the one in atomic-plugins) and.gitignore.README.mdis now a short pointer to atomic-plugins plus instructions for deploying a newer version..github/workflows/ci.yml: now runs onlycargo fmt --check,cargo clippy --locked -D warnings,cargo build --locked --release, and a check that the unconfigured binary exits withconfiguration error:. The proxy's own tests, including the PostgreSQL ones, run in atomic-plugins'integration-proxy-ci.yml.Divergence check
Before deleting anything, I diffed
src/,static/,tests/,Cargo.tomlandProcfilehere againstontola/atomic-pluginsintegration-proxy/at494eb8a. Nothing exists only in production:main(c02b5e5) is an ancestor ofontola/atomic-pluginsmain, merged in byf46ca3a, so every commit here is already in atomic-plugins.static/andtests/are byte-identical.src/,Cargo.tomlandProcfileall come from later atomic-plugins commits (88cda53,075c9fb,b451747). They are listed under "Behaviour changes" below. The oldmain.rsbody moved intolib.rsunchanged, apart from its error handling.Heroku buildpacks and
APP_BASEThe buildpacks are, in order,
lstoll/heroku-buildpack-monorepoandemk/heroku-buildpack-rust. The repository layout is unchanged:Cargo.toml,Cargo.lock,Procfileand nowrust-toolchainare all at the repo root, as before. WhateverAPP_BASEmakes the current production build work will therefore keep working.What I checked about
APP_BASE, running the monorepo buildpack'sbin/compilein anubuntu:24.04container:APP_BASE was not set. Aborting..or./: the build fails withmv: cannot move '/build/.' ...: Device or resource busy/FAILED to copy directory into place.Nothing in this repo's history or docs says what
APP_BASEproduction uses. Given the results above, the monorepo buildpack does nothing useful for a repo whose app sits at the root. Before merging, runheroku buildpacks -a <app>andheroku config:get APP_BASE -a <app>. The simplest safe setup is to remove the monorepo buildpack:heroku buildpacks:remove lstoll/heroku-buildpack-monorepo -a <app>.emk/heroku-buildpack-rustreads the plainrust-toolchainfile and runscargo build --releasein the build dir. Cargo fetches the git dependency itself; the build does not need agitbinary.Behaviour changes
These come from atomic-plugins commits made after this repo was merged in:
CATALOG_PATH, the proxy used to loadhttps://raw.githubusercontent.com/localthought/overlays/5d344a62…/catalog.json, pinned to a commit. It now loadshttps://ontola.github.io/atomic-plugins/overlays/catalog.json, which GitHub Pages publishes from atomic-pluginsmain. This URL is not pinned: each restart or dyno cycle picks up whatevermainhas published at that moment. I compared the two catalogs: all seven existing platforms (github-issues, google-calendar, moneybird, todoist, spotify, discord, notion) have the same OAD URLs and selections, and their overlay files are byte-identical. That includes the google-calendar PATCH change from Bump DEFAULT_CATALOG_PATH: google-calendar events now support PATCH #75. The only difference is thatclockifyis added, using an API-key scheme. If Heroku setsCATALOG_PATH, none of this applies.CONNECTION_CODE_IDLE_DAYS; issue Keep GitHub pagination within catalog-approved repository paths #42 in atomic-plugins). Before, a client that stopped syncing for 10 minutes lost its refresh token. The trade-off: a leaked but unused code now stays redeemable for up to 30 days. Codes are still single-use. There is no schema change.auth_proxytoatomic_integration_proxy. ARUST_LOGfilter such asauth_proxy=debughas to becomeatomic_integration_proxy=debug. The startup line is unchanged:auth-proxy listening on http://0.0.0.0:$PORT.Heroku config vars are otherwise unchanged. The crate reads the same environment variables with the same defaults.
Verification (local, macOS, rustc 1.98.1)
cargo build --release --lockedpassed, and so didcargo clippy --all-targets -- -D warningsandcargo fmt --check.configuration error: APP_AUTH_CLIENT_ID must be setand exited with status 1.postgres:16-alpinecontainer and the default catalog:/healthzreturnedok(200)./catalogreturned["clockify","discord","github-issues","google-calendar","moneybird","notion","spotify","todoist"]./catalog/clockify.yaml,/and/logo.pngall returned 200.APP_BASE,CATALOG_PATHorRUST_LOGset.Rollback
heroku releases:rollback -a <app>goes back to the previous slug. No build is needed, and there is no database migration to undo.main(git revert -m 1 <merge sha>) and push. That restores the full source and the old pinned catalog.🤖 Generated with Claude Code