Skip to content

6009 - adding null guard checks for .profile, also fixing an issue tr…#924

Merged
cody-seibert-gsa merged 3 commits into
mainfrom
6009-null-profile-check
Jun 12, 2026
Merged

6009 - adding null guard checks for .profile, also fixing an issue tr…#924
cody-seibert-gsa merged 3 commits into
mainfrom
6009-null-profile-check

Conversation

@cody-seibert-gsa

@cody-seibert-gsa cody-seibert-gsa commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

work on GSA/data.gov#6009

adding a helper function inside .profile to verify variables are correctly set and throws an error if they are not.

@cody-seibert-gsa cody-seibert-gsa marked this pull request as ready for review June 10, 2026 19:22
@cody-seibert-gsa cody-seibert-gsa requested a review from a team June 10, 2026 19:22
Comment thread .profile Outdated
path="$2"
service_name=${APP_NAME}-${name}
echo $VCAP_SERVICES | jq --raw-output --arg service_name "$service_name" ".[][] | select(.name == \$service_name) | $path"
echo $VCAP_SERVICES | jq --raw-output --arg service_name "$service_name" ".[][] | select(.name == \$service_name) | ($path // empty)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legitimate bool false values will be invalidated by ($path // empty)
we can do explicit null check
$path | if . == null then empty else . end

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

@FuhuXia FuhuXia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the edits.

@cody-seibert-gsa cody-seibert-gsa merged commit bd9b63d into main Jun 12, 2026
9 checks passed
@cody-seibert-gsa cody-seibert-gsa deleted the 6009-null-profile-check branch June 12, 2026 18:36
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