Skip to content

Add campaign reschedule CLI command - #40

Merged
purpshell merged 2 commits into
devfrom
codex/campaigns-reschedule-20260926
Oct 5, 2026
Merged

purpshell merged 2 commits into
devfrom
codex/campaigns-reschedule-20260926

Conversation

@purpshell

@purpshell purpshell commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

A waiting campaign can move its scheduled start through polymorfa campaign reschedule. The command accepts one of --scheduled-at (ISO instant or Unix milliseconds) and --now, sends a generated or caller-supplied idempotency key, and reports the accepted lifecycle operation. It uses the typed Messaging SDK method and refuses browser client tokens before transport. A known 409 conflict is reported after one request.

This is a draft because the API and SDK are not merged or published. The command was checked locally against SDK PR #310 head 16318f057c62192f36933878fb0a48a74f9f56c1, which follows API PR #321 head bb97a3a425110b2eea056735cd3b680f53a98d46. The registry dependency remains at the existing version; after the SDK release is verified, pin its exact published version and regenerate the lockfile before merging this CLI PR.

Part Assessment
API Blocked on #321: the new Messaging reschedule route and 403/409 behavior are defined at the pinned head above; no API code changes here.
SDKs Blocked on polymorfa/sdks#310: this command calls its typed campaigns.reschedule method. SDK publication and registry integrity remain unverified.
CLI Updated: command, help, service wrapper, README examples, credential guard, one-of validation, idempotency key handling, JSON/human output and exit behavior.
Docs Updated: CLI README command examples and accepted-operation guidance. API Mintlify content lives in #321; no shipped changelog claim is made here.
Feature release Blocked: no API deployment, SDK publication, CLI publication or live-send acceptance. The API release record in #321 owns stage and rollback.
Admin controls Unaffected: the existing campaign read exposes scheduledAt; the CLI adds no staff action or Admin state.

Local verification with the unpublished SDK draft: 22 campaign command tests, CLI typecheck, build, lint, formatting, and diff check pass. The tests cover time parsing, --now, invalid flags, client-token refusal and one-request 409 handling. Remote CI cannot verify the typed method against the old registry pin until SDK publication.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T06:05:39.686745Z f81a7c8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 15324be338

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f81a7c8b0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +47 to +49
const scheduledAt = flags.now
? null
: parseCampaignSchedule(flags['scheduled-at'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject normalized invalid calendar dates

When --scheduled-at contains an impossible date such as 2026-02-31T12:00:00Z, parseCampaignSchedule relies on Date.parse, which normalizes it to March 3 rather than rejecting it. The command therefore sends a valid but unintended timestamp, so a user can silently reschedule a campaign to the wrong day; validate that the parsed calendar components match the supplied ISO instant before transport.

Useful? React with 👍 / 👎.

@purpshell
purpshell merged commit 2b5fccf into dev Oct 5, 2026
2 of 3 checks passed
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