Repository navigation
Start every job from the Lambda's own mission - #32
Merged
Merged
Conversation
Importing swxsoc_reach or padre_craft now forces SWXSOC_MISSION to swxsoc_pipeline or padre and reconfigures swxsoc for the whole process. The executor imported swxsoc_reach at module load, so the image built on 2026-09-09 ran GOES and STIX imports as swxsoc_pipeline and tried to write to swxsoc_pipeline_measures_table, which does not exist. Defer the swxsoc_reach import to the REACH job and restore the mission the Lambda environment configured before every job, so nothing left in a warm container by the REACH or PADRE orbit jobs reaches the next one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Alrobbertz
approved these changes
Sep 9, 2026
There was a problem hiding this comment.
🟡 Changes recommended
Repeated PADRE invocations can use the wrong mission and write to the wrong Timestream table; focused deferred-import coverage is also needed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR isolates mission configuration between warm Lambda invocations and defers the REACH import to reduce cold-start risk.
Changes:
- Restores the Lambda mission before each job.
- Adds a deferred REACH import wrapper.
- Adds mission-reset tests.
File summaries
| File | Summary |
|---|---|
lambda_function/tests/test_executor.py |
Adds tests for mission restoration behavior. |
lambda_function/src/executor/executor.py |
Implements deferred imports and mission resetting. Critical finding (2 votes): repeated PADRE runs need explicit reconfiguration after package caching. Nit (1 vote): add focused coverage for the deferred-import wrapper. |
Review details
Suppressed comments (1)
lambda_function/src/executor/executor.py:42
- The REACH test replaces
src.executor.executor.download_UDL_reach_windowbefore invoking the job, so this deferred import is never executed by the suite. A focused test should patchswxsoc_reach.net.udl.download_UDL_reach_windowand call the wrapper (or the job without replacing the wrapper) to verify the import path and keyword forwarding; otherwise the change that prevents the cold-start import regression can silently be broken while all current tests pass.
from swxsoc_reach.net.udl import download_UDL_reach_window as download
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if self.function_name not in self.function_mapping: | ||
| raise ValueError(f"Function '{self.function_name}' is not recognized.") | ||
| log.info(f"Executing function: {self.function_name}") | ||
| self.reset_mission() |
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.
Problem
Since the image built on 2026-09-09 (
20260909192833), everyimport_GOES_data_to_timestreamrun fails:Until 18:54Z the same job wrote to
swxsoc_sdc_aws_logs/swxsoc_measures_tableas it always has.Cause
swxsoc/swxsoc_reach#58 and PADRESat/padre_craft#28 (both merged 2026-08-24, after the previous executor image was built) force
SWXSOC_MISSIONand callswxsoc.reconfigure()when the package is imported. The executor importedswxsoc_reach.net.udlat module load, so every cold start now runs asswxsoc_pipeline, andswxsoc.db.timeseries.record_timeseriesderives the Timestream table from that mission. The Lambda's environment was not changed; the base Terraform plan touched only the image and tags.Fix
swxsoc_reachis imported inside the REACH job through a wrapper that keeps thedownload_UDL_reach_windowname the tests patch.DEFAULT_MISSIONcaptures the Lambda's ownSWXSOC_MISSIONat module load, andExecutor.execute()restores it before every job. A warm container that just ran the REACH or PADRE orbit job can no longer leakswxsoc_pipelineorpadreinto GOES or STIX.Deferring the import also trims the cold start, which hit the 10 s init timeout on the new image.
Verification
ruff checkandruff format --checkclean.test_get_padre_orbit_dataneeds padre_craft's full dependency tree, which the local environment could not build, so CI covers it.🤖 Generated with Claude Code