From ef4b5c138d012f6d51cb40375cfb1e188b3ea8da Mon Sep 17 00:00:00 2001 From: Jeny Sadadia Date: Wed, 18 Sep 2024 16:22:33 +0530 Subject: [PATCH] Send repo URL as context variable Provide `stable-rc` repo URL as context variable to `stable_rc_revision_description` template. It will enable us to re-use the same template to get revision description information for a different tree such as `omap`. Signed-off-by: Jeny Sadadia --- kcidb/monitor/subscriptions/linux_stable_rc.py | 3 ++- kcidb/templates/stable_rc_revision_description.txt.j2 | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/kcidb/monitor/subscriptions/linux_stable_rc.py b/kcidb/monitor/subscriptions/linux_stable_rc.py index 912540c6..a6033e5c 100644 --- a/kcidb/monitor/subscriptions/linux_stable_rc.py +++ b/kcidb/monitor/subscriptions/linux_stable_rc.py @@ -32,5 +32,6 @@ def match_revision(revision): "Shreeya Patel "], body='{% include "stable_rc_revision_description.txt.j2" %}', cc=["KernelCI Results Staging "], - due=datetime.now(timezone.utc) + timedelta(hours=3) + due=datetime.now(timezone.utc) + timedelta(hours=3), + context={'main_repo_url': repo_url} ),) diff --git a/kcidb/templates/stable_rc_revision_description.txt.j2 b/kcidb/templates/stable_rc_revision_description.txt.j2 index c3a0b719..6d91b37b 100644 --- a/kcidb/templates/stable_rc_revision_description.txt.j2 +++ b/kcidb/templates/stable_rc_revision_description.txt.j2 @@ -29,15 +29,12 @@ REVISION {% if revision.git_commit_hash %} {{- " hash: " + revision.git_commit_hash }} {% endif %} - {# The stable-rc repo's URL #} - {% set stable_rc_repo = 'https://git.kernel.org/pub/scm/linux/' + - 'kernel/git/stable/linux-stable-rc.git' %} {# List of other repo's URLs #} {% set other_repos = revision.repo_branch_checkouts.keys() | - reject('==', stable_rc_repo) | reject("none") | list %} + reject('==', main_repo_url) | reject("none") | list %} Checked out from {{- "\n " + - (([stable_rc_repo] + (revision.repo_branch_checkouts[stable_rc_repo] | list)) | + (([main_repo_url] + (revision.repo_branch_checkouts[main_repo_url] | list)) | reject("none") | join(" ")) }} {% if other_repos %} Also checked out from