Skip to content

fix(ashby): sync monthly and hourly compensation to the CMS - #697

Open
koenbok wants to merge 1 commit into
mainfrom
devin/ashby-monthly-compensation-1789119827
Open

koenbok wants to merge 1 commit into
mainfrom
devin/ashby-monthly-compensation-1789119827

Conversation

@koenbok

@koenbok koenbok commented Sep 11, 2026

Copy link
Copy Markdown
Member

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 compensation field's getValue in plugins/ashby/src/dataSources.ts checked key presence:

if ("scrapeableCompensationSalarySummary" in value) {
    return value.scrapeableCompensationSalarySummary
}
if ("compensationTierSummary" in value) {
    return value.compensationTierSummary
}

Both keys are always present in the Ashby Posting API response (CompensationSchema declares them v.nullable(v.string())). Ashby only populates scrapeableCompensationSalarySummary for yearly salaries, so for monthly/hourly roles the first branch matches and returns null; the compensationTierSummary fallback was unreachable.

Fix

Fall back on null, not on key presence:

return compensation.scrapeableCompensationSalarySummary ?? compensation.compensationTierSummary

Extracted into an exported extractCompensationSummary helper (same style as the existing extractLocation) and validated with the now-exported CompensationSchema, matching how the sibling address/region/country fields parse with JobAddressSchema.

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:

  • prefers the scrapeable salary summary when present
  • falls back to the tier summary when the scrapeable summary is null
  • returns null when neither summary exists or the input is not an object

Verification

cd plugins/ashby
yarn check-vitest      # 17 passed
yarn check-typescript  # ok
yarn check-eslint      # ok
yarn check-biome       # ok

Copilot AI lite review requested due to automatic review settings September 11, 2026 09:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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.

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