feat(memory-server): add generic task system columns and migration#248
Merged
Hyperkid123 merged 1 commit intoJun 17, 2026
Merged
Conversation
ba2b5ce to
ce623d8
Compare
florkbr
approved these changes
Jun 16, 2026
| """Migration 001: Add generic task system columns and backfill from jira_key. | ||
|
|
||
| Additive only — no columns removed, no constraints changed. | ||
| Idempotent — safe to run multiple times (skips rows where external_key is already set). |
|
|
||
| SCHEMA_PATH = Path(__file__).parent.parent / "schema.sql" | ||
|
|
||
| JIRA_BASE_URL = "https://issues.redhat.com/browse" |
Collaborator
There was a problem hiding this comment.
Nit: should probably pull from an env var like other vars below, not blocking though.
Collaborator
Author
There was a problem hiding this comment.
Good call — updated to read from the JIRA_URL env var (required, no fallback). Already configured in deploy/template.yaml. Tests set it via os.environ.setdefault and the Tekton pipeline now passes it too.
RHCLOUD-48376 Stage 1 of the generic task system migration (RHCLOUD-48375). Adds external_key, source_type, source_url, and artifacts columns to all relevant tables. Includes idempotent backfill script that copies jira_key values and builds artifacts JSONB from PR data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ce623d8 to
d08a3df
Compare
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
Stage 1 of the generic task system migration (RHCLOUD-48376, parent epic RHCLOUD-48375).
Additive only — no columns removed, no behavior changed, no API changes. The bot keeps working on old columns unaware of the new ones.
What's in this PR
external_key,source_type,source_url,artifactscolumns to 6 tables (tasks, bot_status, bot_instances, cycles, slack_notifications, memories). All nullable, no constraints yet.m001_generic_tasks.py): Idempotent backfill that copiesjira_key→external_key, setssource_type = 'jira', constructssource_url, and buildsartifactsJSONB array frompr_number/pr_url+metadata.prs[]with URL deduplication.What this does NOT change
Test plan
ADD COLUMN IF NOT EXISTS)