Skip to content

Conversation

sfc-gh-hpathak
Copy link
Collaborator

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-NNNNNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.


This PR updates the Jira workflows (.github/workflows/jira_close.yml, .github/workflows/jira_issue.yml) to use curl. Atlassian marketplace actions are deprecated and we also want to remove dependency on another repo.

Fix indentation and formatting issues in the Jira close workflow.
Comment on lines +29 to +32
curl -X POST \
--url "$JIRA_API_URL" \
--user "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
--header "Content-Type: application/json" \
Copy link
Contributor

Choose a reason for hiding this comment

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

The line continuation backslashes in the curl commands have trailing spaces, which will cause the commands to fail in bash. For proper line continuation, remove the spaces after each backslash:

curl -X POST \
  --url "$JIRA_API_URL" \
  --user "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
  --header "Content-Type: application/json" \

This issue appears in both workflow files. All backslashes used for line continuation should have no trailing spaces.

Suggested change
curl -X POST \
--url "$JIRA_API_URL" \
--user "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
--header "Content-Type: application/json" \
curl -X POST \
--url "$JIRA_API_URL" \
--user "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
--header "Content-Type: application/json" \

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +24 to +25
TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\"/g' | sed "s/'/\'/g")
BODY=$(echo '${{ github.event.issue.body }}' | sed 's/"/\"/g' | sed "s/'/\'/g")
Copy link
Contributor

Choose a reason for hiding this comment

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

The current sed commands for escaping special characters won't properly handle all JSON escape sequences needed for the API request. For more robust JSON escaping, consider using jq:

TITLE=$(echo '${{ github.event.issue.title }}' | jq -R -s .)
BODY=$(echo '${{ github.event.issue.body }}' | jq -R -s .)

This approach will properly escape all special characters according to JSON standards, preventing potential API errors when the title or body contains quotes, newlines, or other special characters.

Suggested change
TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\"/g' | sed "s/'/\'/g")
BODY=$(echo '${{ github.event.issue.body }}' | sed 's/"/\"/g' | sed "s/'/\'/g")
TITLE=$(echo '${{ github.event.issue.title }}' | jq -R -s .)
BODY=$(echo '${{ github.event.issue.body }}' | jq -R -s .)

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

permissions:
issues: write
if: (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]')
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be an issue with the conditional check for issue events. The property github.event.pull_request.user.login is being referenced, but issue events don't have a pull_request property. This should be changed to github.event.issue.user.login instead to correctly filter based on the issue creator.

Suggested change
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.issue.user.login != 'whitesource-for-github-com[bot]'))

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

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.

1 participant