Skip to content

CP-14163 - Fail loudly when CareerPlug webhook config is missing#74

Merged
bernardodsanderson merged 2 commits into
mainfrom
CP-14163
Jun 25, 2026
Merged

CP-14163 - Fail loudly when CareerPlug webhook config is missing#74
bernardodsanderson merged 2 commits into
mainfrom
CP-14163

Conversation

@bernardodsanderson

Copy link
Copy Markdown
Collaborator

What

Account and Partnership creation no longer silently skips webhook setup when CAREERPLUG_WEBHOOK_URL/CAREERPLUG_WEBHOOK_SECRET are blank. The callbacks now log a prominent error (including the account/partnership id) and report to Airbrake, then still skip creation. Added a production boot-time initializer that does the same check on startup, so a missing config is impossible to miss on deploy. Made Partnership#create_careerplug_webhook private to match Account.

Why

In DocuSeal prod, these env vars were blank, so the create callbacks silently no-op'd and never produced WebhookUrl records. DocuSeal therefore never sent completion webhooks to the ATS, leaving ~97% of forms (248+ in the last 60 days) stuck at "assigned" and managers never seeing the Approve / Request Changes buttons. The silent skip let this rot undetected; now a missing config is loud and visible instead.

How to test

bundle exec rspec spec/models/account_spec.rb spec/models/partnership_spec.rb spec/initializers/careerplug_webhook_config_spec.rb In rails console, with both vars blank, Account.create!(name: 'x') logs an error and creates no webhook; with the vars set, it creates a WebhookUrl with the full event set and the correct X-CareerPlug-Secret. Only affects accounts/partnerships created after deploy; existing data is handled by the backfill/reconciliation tickets.

What
Account and Partnership creation no longer silently skips webhook setup when CAREERPLUG_WEBHOOK_URL/CAREERPLUG_WEBHOOK_SECRET are blank. The callbacks now log a prominent error (including the account/partnership id) and report to Airbrake, then still skip creation. Added a production boot-time initializer that does the same check on startup, so a missing config is impossible to miss on deploy. Made Partnership#create_careerplug_webhook private to match Account.

Why
In DocuSeal prod, these env vars were blank, so the create callbacks silently no-op'd and never produced WebhookUrl records. DocuSeal therefore never sent completion webhooks to the ATS, leaving ~97% of forms (248+ in the last 60 days) stuck at "assigned" and managers never seeing the Approve / Request Changes buttons. The silent skip let this rot undetected; now a missing config is loud and visible instead.

How to test
bundle exec rspec spec/models/account_spec.rb spec/models/partnership_spec.rb spec/initializers/careerplug_webhook_config_spec.rb
In rails console, with both vars blank, Account.create!(name: 'x') logs an error and creates no webhook; with the vars set, it creates a WebhookUrl with the full event set and the correct X-CareerPlug-Secret.
Only affects accounts/partnerships created after deploy; existing data is handled by the backfill/reconciliation tickets.

@spaulsandhu spaulsandhu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good, while poking around Airbrake I actually found something we should look at as well!

https://careerplug.airbrake.io/projects/634608/groups/4347233669487726254?tab=notice-detail

Unrelated to this work of course, I'll create a ticket for that airbrake, so LGTM

@bernardodsanderson bernardodsanderson merged commit eafa510 into main Jun 25, 2026
5 checks passed
@bernardodsanderson bernardodsanderson deleted the CP-14163 branch June 25, 2026 21:13
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