Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues remain, and the compensation fallback is covered by tests.
Pull request overview
Fixes Ashby CMS compensation syncing for monthly, hourly, and equity-only roles.
Changes:
- Adds null-aware compensation summary fallback.
- Exports
CompensationSchema. - Adds unit tests for compensation extraction.
File summaries
| File | Summary |
|---|---|
plugins/ashby/src/dataSources.ts |
Uses the compensation extraction helper. |
plugins/ashby/src/dataSources.test.ts |
Tests salary and tier-summary fallback behavior. |
plugins/ashby/src/api-types.ts |
Exports CompensationSchema. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Problem
When a role in Ashby uses monthly (or hourly / equity-only) compensation, the Compensation field in the synced Framer CMS collection is empty. Yearly roles sync fine (e.g.
€100K - €150K).Reported by a customer (Morten Korshavn).
Root cause
The
compensationfield'sgetValueinplugins/ashby/src/dataSources.tschecked key presence:Both keys are always present in the Ashby Posting API response (
CompensationSchemadeclares themv.nullable(v.string())). Ashby only populatesscrapeableCompensationSalarySummaryfor yearly salaries, so for monthly/hourly roles the first branch matches and returnsnull; thecompensationTierSummaryfallback was unreachable.Fix
Fall back on
null, not on key presence:Extracted into an exported
extractCompensationSummaryhelper (same style as the existingextractLocation) and validated with the now-exportedCompensationSchema, matching how the siblingaddress/region/countryfields parse withJobAddressSchema.Monthly roles now sync Ashby's tier summary, which already includes the interval (e.g.
€8K – €12K / month), so a separate "monthly compensation" field is not needed for this bug.Tests
Added unit tests for
extractCompensationSummary:nullnullwhen neither summary exists or the input is not an objectVerification