Skip to content

Add Mozilla Foundation Greenhouse instance - #17366

Draft
bluewave41 wants to merge 2 commits into
mainfrom
wt-1617-update-greenhouse-integration
Draft

Add Mozilla Foundation Greenhouse instance#17366
bluewave41 wants to merge 2 commits into
mainfrom
wt-1617-update-greenhouse-integration

Conversation

@bluewave41

@bluewave41 bluewave41 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

One-line summary

Adds additional Mozilla Foundation Greenhouse URL

Issue / Bugzilla link

https://mozilla-hub.atlassian.net/jira/for-you?tab=assigned&selectedIssue=WT-1617

Testing

That test job comes from https://boards-api.greenhouse.io/v1/boards/mozillafoundation/jobs?content=true. The other jobs come from https://boards-api.greenhouse.io/v1/boards/mozilla/jobs?content=true

@bluewave41
bluewave41 requested review from a team as code owners September 9, 2026 15:56
@bluewave41
bluewave41 force-pushed the wt-1617-update-greenhouse-integration branch from 971e8b0 to 02c845c Compare September 9, 2026 15:56
@bluewave41 bluewave41 changed the title Wt 1617 update greenhouse integration Add Mozilla Foundation Greenhouse instance Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.18%. Comparing base (025842d) to head (02c845c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17366   +/-   ##
=======================================
  Coverage   83.17%   83.18%           
=======================================
  Files         180      180           
  Lines        9402     9407    +5     
=======================================
+ Hits         7820     7825    +5     
  Misses       1582     1582           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

🟡 Changes recommended

The Ashby command is currently unusable and can delete Greenhouse data, while nullable grouping IDs can merge unrelated jobs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds Mozilla Foundation Greenhouse jobs to the careers listings, but also introduces an unrelated Ashby integration with blocking defects.

Changes:

  • Fetches jobs from both Greenhouse boards.
  • Expands job IDs and permits nullable internal IDs.
  • Adds an Ashby synchronization command.

Assessment: Not safe to merge until grouping, Ashby API, and cross-source deletion issues are fixed. Reviewed using the repository custom instructions.

File summaries
File Description
bedrock/settings/base.py Configures the Foundation board.
bedrock/careers/models.py Expands and relaxes job identifier fields.
bedrock/careers/migrations/0004_alter_position_internal_job_id_alter_position_job_id.py Applies schema changes.
bedrock/careers/management/commands/sync_greenhouse.py Aggregates both Greenhouse boards.
bedrock/careers/management/commands/sync_ashby.py Adds Ashby job synchronization.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 6
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"""Sanitize Ashby job description HTML."""
# Convert h1/h2/h3 to h4 for consistent heading levels
content = _HEADER_RE.sub(r"<\1h4\3", content)
return JustHTML(content, safe=True, policy=_SANITIZE_POLICY, fragment=True).to_html(pretty=False)
Comment on lines +87 to +91
for source in sources:
response = requests.get(source)
response.raise_for_status()
data = response.json()
jobs_list.extend(data["jobs"])
response = requests.get("https://api.ashbyhq.com/location.list")
response.raise_for_status()
data = response.json()
locations = data["results"]
jobs_updated += 1
position.save()

positions_to_be_removed = Position.objects.exclude(job_id__in=job_ids, source="ashby")
Comment thread bedrock/careers/models.py
# Store the Greenhouse internal ID for grouping the same jobs with multiple
# listings per location.
internal_job_id = models.PositiveIntegerField()
internal_job_id = models.PositiveIntegerField(null=True)
jobs_updated = 0
jobs_removed = 0
job_ids = []
sources = [GREENHOUSE_URL.format(settings.GREENHOUSE_BOARD), GREENHOUSE_URL.format(settings.FOUNDATION_GREENHOUSE_BOARD)]

@stevejalim stevejalim 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.

Looking very promising - thanks! Have added some human commetns, and also unleashed the robot.

This will need tests before we can merge it, though - feel free to call on a robot for that, if you want

Comment thread bedrock/settings/base.py
}

GREENHOUSE_BOARD = config("GREENHOUSE_BOARD", default="mozilla")
FOUNDATION_GREENHOUSE_BOARD = config("FOUNDATION_GREENHOUSE_BOARD", default="mozillafoundation")

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.

nit, totally optional, nonblocking: this is fine, but each time we need to add a new Greenhouse option, we'll need a new const. What do you think of

GREENHOUSE_BOARDS = [
    config("GREENHOUSE_BOARD", default="mozilla"),
    config("FOUNDATION_GREENHOUSE_BOARD", default="mozillafoundation"),
]

...and loop through those for sources in sync_greenhouse?

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.

Is this one meant to be in here yet? The PR only mentions Greenhouse.

If we're going to also sync Ashby, we'll need to add a line to ./bin/run-db-update.sh like the Greenhouse one in there

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.

No, rebase went wild. I had filtered it out and it got filtered back in after and I didn't notice.

@bluewave41
bluewave41 marked this pull request as draft September 9, 2026 17:51
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.

3 participants