CP-14163 - Fail loudly when CareerPlug webhook config is missing#74
Merged
Conversation
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
approved these changes
Jun 25, 2026
spaulsandhu
left a comment
Member
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.