This repository was archived by the owner on Jul 6, 2026. It is now read-only.
Add search param to run API v1#2603
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
mikesmit
approved these changes
Jun 9, 2025
mikesmit
left a comment
Collaborator
There was a problem hiding this comment.
We'll need to manually integration test this after deploy. LGTM.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a temporary run_api_v1 search parameter to toggle use of API v1 in simulation URL builders.
- Introduces a
run_api_v1flag from URL search params in impact and cliff-impact components - Appends
&run_api_v1=trueto simulation request URLs when the flag is set - No automated tests have been added for the new behavior
Comments suppressed due to low confidence (3)
src/pages/policy/output/FetchAndDisplayImpact.jsx:43
- [nitpick] The variable name
run_api_v1uses snake_case while the codebase uses camelCase. Consider renaming it torunApiV1for consistency.
const run_api_v1 = searchParams.get("run_api_v1") === "true";
src/pages/policy/output/FetchAndDisplayImpact.jsx:43
- [nitpick] Add a
// TODO: remove this flag once v2 API is validatedcomment here to indicate the temporary nature of therun_api_v1parameter.
const run_api_v1 = searchParams.get("run_api_v1") === "true";
src/pages/policy/output/FetchAndDisplayImpact.jsx:112
- There are no tests covering the new
run_api_v1URL parameter. Add unit or integration tests to verify that the query string is built correctly when this flag is toggled.
`&version=${version}${maxHouseholdInput}${datasetInput}${runApiV1Input}`;
| ? `&max_households=${maxHouseholds}` | ||
| : ""; | ||
|
|
||
| const runApiV1Input = run_api_v1 ? `&run_api_v1=${run_api_v1}` : ""; |
There was a problem hiding this comment.
[nitpick] The conditional string-building logic for run_api_v1 is duplicated in multiple places. Consider extracting to a helper function or constant to reduce repetition.
Suggested change
| const runApiV1Input = run_api_v1 ? `&run_api_v1=${run_api_v1}` : ""; | |
| const runApiV1Input = getRunApiV1Input(run_api_v1); |
nikhilwoodruff
approved these changes
Jun 10, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Fixes #2602.
Requires PolicyEngine/policyengine-api#2558.
Changes
This PR adds a temporary search param,
run_api_v2, which activates the use of API v1. This should be removed once we are confident with the new simulation API's results.Screenshots
N/A
Tests
None have been added.