You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a02b65f
Browse filesBrowse the repository at this point in the historyBrowse files
Comment commands address the adopter's own App (#131)
* Comment commands address the adopter's own App
App names are globally unique, so every installation has a different bot
login. A constant handle could never be right in more than one repository:
ours matched nothing in anyone else's, and because our App is public it
rendered there as a mention of an account they never installed.
/simplycubed avoided that but gave up the thing that makes a handle worth
having. GitHub offers accounts with repository access in the autocomplete,
so a real mention completes after someone types @A, without them knowing
the bot's name. A prefix that is not an account cannot, and typing / opens
GitHub's own menu, which then matches nothing.
appName in .github/simplycubed.yml is the source of truth. The parser, the
help text, and the wrong-surface replies all render from it, so the agent
never tells anyone to mention a different account.
The workflow trigger stays a literal, written by init from the same value.
A workflow decides whether to start before any code runs, so matching
loosely there would spin up a runner every time someone mentions a
colleague: token, checkout, Go, CLI, sandbox, roughly thirty seconds, to
then do nothing.
That means the handle lives in two files and the App can only push one of
them. preflight fails when they disagree, because the alternative is
silent: comments stop working with no error anywhere.
* Cover the paths this change introduced
Codecov flagged 10 uncovered lines across main.go and command.go. Every
one was a branch the change added and nothing exercised.
resolveAppName decides what handle init writes, so each way it can be
reached is now pinned: the flag, an existing config, the flag overriding a
config, and neither. That last one matters most, because the error has to
explain that the name is the adopter's rather than just demand a flag.
appNameFor parses --repo-dir out of flags it does not own; both spellings
are covered, since reading the wrong repository's config would silently
answer as the wrong bot.
Addressed and Parse with no configured App: a repository that has not said
which App it installed has no handle to answer to.
commandCmd surfacing a config error rather than parsing nothing, which
would look like a comment the agent chose to ignore.
Copy file name to clipboardExpand all lines: README.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,9 +96,19 @@ You drive the agent by applying one label and reading the pull request. The bot
96
96
97
97
You can also drive it by comment, addressed to the bot at the start of a line:
98
98
99
-
-`/simplycubed go` on an issue starts work on it, the same as applying `sc:go`.
100
-
-`/simplycubed address` on a pull request addresses the current review feedback.
101
-
-`/simplycubed help` lists what it understands.
99
+
Commands address **your own App**, not ours. If you installed an App called
100
+
`acme-code`, your team types:
101
+
102
+
-`@acme-code go` on an issue starts work on it, the same as applying `sc:go`.
103
+
-`@acme-code address` on a pull request addresses the current review feedback.
104
+
-`@acme-code help` lists what it understands.
105
+
106
+
The handle is per-repository because App names are globally unique, so every
107
+
installation has its own. It is also why GitHub offers the bot in the
108
+
autocomplete after someone types `@`: it suggests accounts with access to the
109
+
repository, which a fixed prefix could never be. You set it once with
110
+
`simplycubed init --app-name`, and it is stored as `appName:` in
111
+
`.github/simplycubed.yml`.
102
112
103
113
Only comments from people with write access are acted on, and only a comment that begins with the mention counts, so quoting an earlier comment never re-triggers a run. Note that a plain pull-request comment is not a review: to run the fixer from a review, submit it through **Files changed → Review changes**.
// No caller workflow is a valid local setup, not a misconfiguration.
466
+
returnnil
467
+
}
468
+
want:="'"+command.MentionFor(appName) +"'"
469
+
ifstrings.Contains(string(b), want) {
470
+
returnnil
471
+
}
472
+
returnfmt.Errorf("%w: .github/simplycubed.yml sets appName %q, but %s does not trigger on %s. Comment commands will never fire. Re-run \"simplycubed init --workflow\" to rewrite the trigger from the config",
returnfmt.Errorf("%w: .github/simplycubed.yml sets no appName. Comment commands address the App you installed, so without it none of them can fire. Add \"appName: <your-app>\" or re-run \"simplycubed init --workflow --app-name <your-app>\"", ErrConfigMissing)
return"", errors.New("--app-name is required: comment commands address the App you installed, and its name is unique to you. Pass the App's name without the \"[bot]\" suffix, for example --app-name acme-code")
0 commit comments