Skip to content

Added GET automations/:id route with placeholder static payload#27692

Open
cmraible wants to merge 4 commits intomainfrom
chris-ny-1265-create-endpoint-for-reading-a-single-automation
Open

Added GET automations/:id route with placeholder static payload#27692
cmraible wants to merge 4 commits intomainfrom
chris-ny-1265-create-endpoint-for-reading-a-single-automation

Conversation

@cmraible
Copy link
Copy Markdown
Collaborator

@cmraible cmraible commented May 6, 2026

refs https://linear.app/ghost/issue/NY-1265/create-endpoint-for-reading-a-single-automation

This adds the scaffolding for the GET automations/:id endpoint in the Admin API, with a hardcoded payload. The intent here is simply to unblock development of the frontend, while we iron out the rest of the schema. This will eventually be updated to return automations from the database, once the schema is in place.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 55f1139a-30d7-42f8-b6a4-cd7fcf404724

📥 Commits

Reviewing files that changed from the base of the PR and between d128c64 and 170b2cd.

⛔ Files ignored due to path filters (1)
  • ghost/core/test/e2e-api/admin/__snapshots__/automations.test.js.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • .secretlintrc.json
  • ghost/core/core/server/api/endpoints/automations.js
  • ghost/core/core/server/web/api/endpoints/admin/routes.js
  • ghost/core/test/e2e-api/admin/automations.test.js
  • ghost/core/test/unit/api/endpoints/automations.test.js

Walkthrough

This pull request adds a new read endpoint to the automations API that returns a static, pre-defined automation payload. The changes include updating the Secretlint configuration regex to add negative lookahead for ${ patterns, adding a new read endpoint in the automations controller with a hardcoded automation payload, adding the corresponding route GET /automations/:id in the admin API routes, and adding unit and end-to-end tests to verify the new read endpoint functionality.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a GET automations/:id route with placeholder static payload, which matches the changeset.
Description check ✅ Passed The description is related to the changeset and explains the intent to scaffold the GET automations/:id endpoint with a hardcoded payload to unblock frontend development.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chris-ny-1265-create-endpoint-for-reading-a-single-automation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cmraible cmraible changed the title Chris ny 1265 create endpoint for reading a single automation Added GET automations/:id route with placeholder static payload May 6, 2026
@cmraible cmraible changed the title Added GET automations/:id route with placeholder static payload Added GET automations/:id route with placeholder static payload May 6, 2026
cmraible added 2 commits May 5, 2026 18:10
The automation read endpoint is still static in this PR, but it should match the upcoming editable automation graph contract so clients can build against the intended actions and edges payload.

The secret scan query-string rule now ignores template interpolation placeholders, keeping the existing token URL tests readable without weakening literal credential detection.
The automation read response still uses temporary static data, so call out NY-1265 at the payload until the endpoint is backed by persisted automation data.
});

await agent
.put(`automations/poll/?token=${invalidSchedulerToken}`)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was causing secretlint to fail, hence the change in .secretlintrc.json, which carves an exception for string interpolation with ${}

@cmraible cmraible marked this pull request as ready for review May 6, 2026 01:22
Comment on lines +37 to +66
return {
id: frame.data.id,
slug: 'member-welcome-email-free',
name: 'Welcome email',
status: 'active',
created_at: '2026-05-05T00:00:00.000Z',
updated_at: '2026-05-05T00:00:00.000Z',
actions: [{
id: '67f3f3f3f3f3f3f3f3f3f3f4',
type: 'wait',
data: {
wait_hours: 24
}
}, {
id: '67f3f3f3f3f3f3f3f3f3f3f5',
type: 'send email',
data: {
email_subject: 'Welcome!',
email_lexical: '{"root":{"children":[]}}',
email_sender_name: null,
email_sender_email: null,
email_sender_reply_to: null,
email_design_setting_id: '680000000000000000000001'
}
}],
edges: [{
source_action_id: '67f3f3f3f3f3f3f3f3f3f3f4',
target_action_id: '67f3f3f3f3f3f3f3f3f3f3f5'
}]
};
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@troyciesco this is sort of a guess of what you'd need on the frontend, feel free to adjust it as needed

@cmraible cmraible requested a review from troyciesco May 6, 2026 01:24
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