Skip to content

Conversation

ccardenosa
Copy link
Collaborator

To cope with shared context conditions among Prow steps in a organized manner

@openshift-ci openshift-ci bot requested review from kononovn and shaior July 15, 2025 08:23
Copy link

openshift-ci bot commented Jul 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign natifridman for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ccardenosa ccardenosa force-pushed the prow-share-context-functions branch 2 times, most recently from 08e784b to 966ebfb Compare July 15, 2025 09:57
…d manner

Signed-off-by: Carlos Cardenosa <ccardeno@redhat.com>
@ccardenosa ccardenosa force-pushed the prow-share-context-functions branch from 966ebfb to 4c6ec70 Compare July 15, 2025 10:14
@eifrach
Copy link
Contributor

eifrach commented Aug 3, 2025

hey I'm a bit confused what is this for?
where we need to use it ?

@ccardenosa
Copy link
Collaborator Author

ccardenosa commented Aug 4, 2025

This script provides functions for managing shared context data among Prow steps in JSON format, like set values using dot notation for nested keys:

update_prow_share_context "deployment.ocp.version" "4.15"
update_prow_share_context "tests.unit.status" "passed"

Then get specific values back from any other Prow step where it might be needed:

version=$(get_prow_share_context_value "deployment.ocp.version")
echo "OCP Version: $version"  # Output: OCP Version: 4.15

status=$(get_prow_share_context_value "tests.unit.status")
echo "Unit test status: $status"  # Output: Unit test status: passed

This is a orderly manner to share info among steps as the whole context is in a single places for all the steps. To view the complete context after updates at any step, just call:

get_prow_share_context
# Output example:
# {
#   "deployment": {
#     "ocp": {
#       "version": "4.15"
#     }
#   },
#   "tests": {
#     "unit": {
#       "status": "passed",
#     }
#   }
# }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants