Repository navigation
Conversation
publish-bill.yml now runs scripts/record_publication.py once the bill is marked published. The script reads the research row and posts one record to the CRM's POST /api/publications/record (Teamverse p454). The record holds the bill, session, App v3 bill page and saved report, the PR, and the filed and approved dates. Fields with no value are left out, so they never blank what the CRM already holds. The step can't fail the publish: - With CRM_PUBLICATIONS_URL or CRM_PUBLICATIONS_TOKEN unset, it prints a notice and records nothing. - Any error is a warning, and the script always exits 0. - continue-on-error backs that up. Inputs reach the script through env only. The contract doc gains a CRM section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ublication-record # Conflicts: # docs/APP_V3_BILL_CONTRACT.md
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.
Summary
When a bill-review PR merges, the bill's approved report is now recorded in the CRM (Teamverse p454). This PR is based on #241, which owns
publish-bill.ymland the App v3 contract. The CRM side is PolicyEngine/CRM#458.Workflow.
publish-bill.ymlhas a new step after the bill is marked published and main is checked out: Record the report in the CRM, which runsscripts/record_publication.py.Script.
record_publication.pyreads the research row (andprocessed_bills.bill_numberthroughlegiscan_bill_id) and builds one record:/us/report/bill/{id}) and the saved report;approved_atandpublished_at(the merge time).It posts the record to the CRM's
POST /api/publications/recordwith a Bearer token. Fields with no value are left out, so a re-run never blanks what the CRM holds.--dry-runprints the record without sending it.Safety.
::notice::and stops;::warning::;continue-on-error: true.${{ }}in the script.Docs.
docs/APP_V3_BILL_CONTRACT.mdgains a "Recorded" lifecycle row and section 5, which maps each CRM field to its source and lists the secrets.Secrets and variables (not set here)
CRM_PUBLICATIONS_URL: the CRM backend's base URL.CRM_PUBLICATIONS_TOKEN: the same value as the CRM backend'sPUBLICATIONS_SERVICE_TOKEN.CRM_PUBLICATIONS_PROJECT_ID(optional repository variable): the Teamverse project. The default isp301.Until the secrets are set, a merge publishes exactly as before, plus one notice line.
Tests
uv run --with pytest pytest scripts/test_record_publication.py scripts/test_publish_analysis.py: 25 passed (17 new). The new tests cover:None of these tests use the network or Supabase. The workflow YAML parses.
🤖 Generated with Claude Code