Skip to content

feat: enhance attendants management with pull request metadata and au… - #8

Merged
ArielAio merged 3 commits into
mainfrom
codex/attendants-pr-auto-merge
Mar 12, 2026
Merged

ArielAio merged 3 commits into
mainfrom
codex/attendants-pr-auto-merge

Conversation

@ArielAio

Copy link
Copy Markdown
Owner

…to-merge functionality

@ArielAio ArielAio self-assigned this Mar 12, 2026
Copilot AI review requested due to automatic review settings March 12, 2026 22:27
@vercel

vercel Bot commented Mar 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
li-rilko Ready Ready Preview, Comment Mar 12, 2026 10:39pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the admin attendants save flow to update attendants via a dedicated work branch + pull request, returning pull request metadata (URL/number), and optionally requesting auto-merge, so the admin UI can surface the PR and status messaging.

Changes:

  • Refactors updateAttendantsInRepository to ensure a work branch exists, write attendants there, open/reuse a PR, and optionally request auto-merge via GitHub GraphQL.
  • Extends the admin API response and admin UI to display PR metadata and more detailed save status messaging.
  • Adds/updates unit tests for the new PR + auto-merge behavior and updates .env.example with new GitHub-related settings.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/attendants-store.js Implements work-branch writes, PR creation/reuse, and auto-merge request; returns PR metadata to callers.
app/api/admin/attendants/route.js Adds PR/branch/auto-merge metadata fields to the PUT response payload.
components/admin/managers/admin-service-manager.js Displays PR link and updates success toast messaging based on PR/auto-merge status.
tests/unit/lib/attendants-store.test.js New unit tests covering branch creation, PR reuse/creation, unchanged handling, and auto-merge failures.
tests/unit/api/admin-attendants-route.test.js Extends API route tests to validate the expanded response contract.
.env.example Documents new env vars for work branch + auto-merge behavior and updated token permissions hint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/attendants-store.js
}

function getGitHubRefUrl(config, branch) {
const encodedBranch = encodeGitHubPath(branch);

Copilot AI Mar 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getGitHubRefUrl() is using encodeGitHubPath() which intentionally un-escapes %2F back to /. That behavior is correct for the Contents API path, but it breaks the Git ref endpoint when branch names contain / (e.g. bot/attendants-admin should be requested as heads/bot%2Fattendants-admin). As written, GitHub will likely return 404 and the work-branch creation flow won’t work for slash-containing branch names. Use a dedicated encoder for refs/branch names (do not unescape %2F) or build the ref URL with encodeURIComponent(branch) (without the %2F replacement).

Suggested change
const encodedBranch = encodeGitHubPath(branch);
const encodedBranch = encodeURIComponent(branch);

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +85
const createPullRequestCall = fetchMock.mock.calls.find(
([url, options]) => String(url).endsWith("/pulls") && options?.method === "POST",
);
expect(createPullRequestCall).toBeTruthy();
expect(JSON.parse(createPullRequestCall[1].body)).toMatchObject({
head: "bot/attendants-admin",
base: "main",
});

Copilot AI Mar 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests cover the slash-containing work branch (bot/attendants-admin) but don’t assert that the Git ref fetch uses the correctly URL-encoded branch name (i.e. bot%2Fattendants-admin). Adding an explicit expectation on the first fetch call URL would prevent regressions in the ref URL encoding logic.

Copilot uses AI. Check for mistakes.
- preserve cart interactions made before localStorage hydration completes

- make checkout smoke wait for item-in-cart confirmation before navigating
- retry add-to-cart until cart storage reflects item

- assert increase button visibility explicitly before click
@ArielAio
ArielAio merged commit 871ebf8 into main Mar 12, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — b42c330b Deployed Mar 12, 2026 by vercel[bot]
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.

2 participants