Skip to content

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Jul 1, 2025

Closes #318

Applied changes based on Issue #318.

I’ve centralized all of the ad-hoc flag handling into a single utility (parseFlags) and refactored processEvent to use it in both the direct-prompt and comment-parsing paths.

Changes in brief:

• Added src/utils/flags.ts
– parseFlags(input, flagNames[]) splits once, builds a flags map, and returns the cleaned-up remainder.

• Updated src/github/event.ts
– Imported parseFlags and removed all repeated .split/.replace flag logic.
– In the direct-prompt branch, we now parse --fix-build and --fetch via parseFlags.
– In the /codex comment branch, we parse all five flags (full-history, create-issues, no-pr, fix-build, fetch) in one go.

This eliminates duplicated splitting/replacement, makes it easy to add or change flags in one place, and keeps behavior identical to before. All existing tests for processEvent should continue to pass unchanged.

@github-actions github-actions bot mentioned this pull request Jul 1, 2025
@YiweiShen YiweiShen merged commit 0b3c32d into main Jul 1, 2025
@YiweiShen YiweiShen deleted the codez-chore-318-refactor-flags-centralize-flag-parsing-3025451377 branch July 1, 2025 21:03
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.

Centralize flag parsing

1 participant