Skip to content

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

Merged
troyciesco merged 5 commits intomainfrom
chris-ny-1265-create-endpoint-for-reading-a-single-automation
May 6, 2026
Merged

Added GET automations/:id route with placeholder static payload#27692
troyciesco merged 5 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: 28364b73-7650-4031-9379-f9fb8087a94f

📥 Commits

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

⛔ 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

Updated Secretlint configuration to tighten the credential-detection regex by adding a negative lookahead for ${ and p. prefixes. Added a new read endpoint to the automations controller that returns a static automation payload, registered the route GET /automations/:id in admin API routes, and added unit and e2e tests for the new endpoint.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: adding a GET automations/:id route with a placeholder static payload.
Description check ✅ Passed The description is directly related to the changeset, explaining the scaffolding for the GET automations/:id endpoint with hardcoded payload and intent 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
});

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
cmraible and others added 5 commits May 6, 2026 14:36
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.
@troyciesco troyciesco force-pushed the chris-ny-1265-create-endpoint-for-reading-a-single-automation branch from 170b2cd to 08f1671 Compare May 6, 2026 18:45
@troyciesco troyciesco merged commit f0035b9 into main May 6, 2026
43 checks passed
@troyciesco troyciesco deleted the chris-ny-1265-create-endpoint-for-reading-a-single-automation branch May 6, 2026 19:16
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