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
[bug] teamai push --branch: team-config edits attach to an existing PR group instead of the new branch #800
teamai push --branch <name> was added in #690 (merged as 9d3a91c). A latent
grouping bug ships with it: when uncommitted teamai.yaml edits are pushed
alongside both an existing open-PR group and a new --branch group, the
config rides on the first group — which is always the reused existing PR —
so the explicit --branch never receives the config, and an unrelated review
gets modified.
Flagged as a P1 in the #690 review and merged as a known issue; filing it for
follow-up.
Root cause
In pushCore() the config rides on the first group and is then cleared:
// src/push.ts:1502letconfigRider=pendingTeamConfig!==null;
...
for(constgroupofgroups){constoutcome=awaitpushGroup({
...
includeTeamConfig: configRider,// src/push.ts:1513branch: options.branch,// src/push.ts:1514});
...
configRider=false;// src/push.ts:1529 — only the first group gets it}
But planPushGroups() (src/utils/pending-push.ts) always orders reused
(existing-PR) groups first and collapses all new resources into the single
trailing group:
// reused entries pushed first…for(constentryofnewestFirst){ ...;groups.push({ items,reuse: entry});}// …new resources appended last as one groupconstrest=selected.filter((i)=>!claimed.has(...));if(rest.length>0)groups.push({items: rest});
So configRider is consumed by the reused group, and --branch (which only
sets branchName for the new group) never carries the config.
Impact
When triggered:
the --branch destination does not get the teamai.yaml change (the
feature silently no-ops for config); and
an unrelated existing open PR is amended with the user's config edit, with no
warning — it can be merged into the default branch as part of that PR and
pollute the team-wide teamai.yaml.
The amendment is silent, so it is easy to miss until it has already spread.
Reproduction
Have an uncommitted teamai.yaml edit in the team-repo clone
(e.g. after teamai source add, which writes but does not commit).
Have at least one unmerged open PR whose resources are selected again this
run (forms a reuse group).
Run teamai push --branch <name> with a new resource in the same run.
Observed: the config lands on the existing PR's branch, not <name>; <name>
carries only the new resource.
Suggested fix
When options.branch is set, route configRider to the new group rather
than the first (reused) group — or reject the ambiguous combination
(edited teamai.yaml + existing-PR group + --branch) with a clear error,
mirroring the existing multi-new-group guard at src/push.ts:1478.
Related
Follow-up to #690 (fixes #663). Known P1 merged deliberately.
Activity