-
Notifications
You must be signed in to change notification settings - Fork 1
feat: norway data added STIT-640 #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
118e998
feat(stitch-ogsi): add nor source key for Norway (Sodir)
mbarlow12 8b1e74c
feat(stitch-auth): add source:read:nor permission
mbarlow12 9128183
feat(api): seed nor source priority
mbarlow12 d1db7a0
feat(frontend): add Norway ETL panel
mbarlow12 2732065
chore: unnecessary comment removal
mbarlow12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
deployments/api/alembic/versions/71aa7ef8150b_add_nor_source_priority.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| """add nor source priority | ||
|
|
||
| Revision ID: 71aa7ef8150b | ||
| Revises: 3a7e120d22d1 | ||
| Create Date: 2026-09-23 00:00:00.000000 | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from alembic import op | ||
| import sqlalchemy as sa | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "71aa7ef8150b" | ||
| down_revision = "3a7e120d22d1" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
| _REV_SOURCE_PRIORITY = ("rmi", "wm", "ccr", "bc", "alb", "nor", "gem", "llm") | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| bind = op.get_bind() | ||
| bind.execute( | ||
| sa.text("UPDATE og_field_source_priority SET priority = priority + 100") | ||
| ) | ||
| existing = { | ||
| row[0] | ||
| for row in bind.execute(sa.text("SELECT source FROM og_field_source_priority")) | ||
| } | ||
| for priority, source in enumerate(_REV_SOURCE_PRIORITY, start=1): | ||
| if source in existing: | ||
| bind.execute( | ||
| sa.text( | ||
| "UPDATE og_field_source_priority SET priority = :priority " | ||
| "WHERE source = :source" | ||
| ).bindparams(priority=priority, source=source) | ||
| ) | ||
| else: | ||
| bind.execute( | ||
| sa.text( | ||
| "INSERT INTO og_field_source_priority (source, priority) " | ||
| "VALUES (:source, :priority)" | ||
| ).bindparams(source=source, priority=priority) | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| raise RuntimeError(f"Irreversible migration: {revision}") | ||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,11 +57,9 @@ const BC_FIELDS = [ | |
| }, | ||
| ]; | ||
|
|
||
| // No run parameters yet: the Alberta dataset hasn't been added to | ||
| // stitch-etl-poc, so the real request-body shape is unknown. Leave empty (no | ||
| // inputs, empty body) until the dataset lands and the fields can be defined to | ||
| // match it. | ||
| // No run parameters needed as of 2026-09-23 for ALB or NOR. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NB: Even with no run params, we probably want to expose the same "use cached" toggle that we have for the others. |
||
| const ALB_FIELDS = []; | ||
| const NOR_FIELDS = []; | ||
|
|
||
| const WOODMAC_FIELDS = [ | ||
| { | ||
|
|
@@ -342,6 +340,13 @@ export default function EtlPage() { | |
| fields={ALB_FIELDS} | ||
| getToken={getToken} | ||
| /> | ||
| <EtlPanel | ||
| title="Norway" | ||
| description="Fetch Norwegian Offshore Directorate (Sodir) field data and post it to Stitch." | ||
| baseUrl={`${config.etlBaseUrl}/nor`} | ||
| fields={NOR_FIELDS} | ||
| getToken={getToken} | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
|
|
||
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB (this time): It would be a good idea to have a DB test (against the applied migrations) that the DB thinks the priority list is the same as the app code
SOURCE_PRIORITY. Out of scope for this PR, but it's an easy spot to have drift.