Skip to content

jira setting#229

Merged
arlen02-01 merged 4 commits intodevelopfrom
OT-18-feature-test-issue-created
Apr 10, 2026
Merged

jira setting#229
arlen02-01 merged 4 commits intodevelopfrom
OT-18-feature-test-issue-created

Conversation

@arlen02-01
Copy link
Copy Markdown
Contributor

@arlen02-01 arlen02-01 commented Apr 10, 2026

📝 작업 내용

이번 PR에서 작업한 내용을 적어주세요

  • 지라 세팅 입니다.

Summary by CodeRabbit

  • 개선 사항

    • 브랜치 생성 시 브랜치명에서 Jira 이슈 키를 감지해 새 GitHub 이슈를 자동 생성합니다.
    • Jira에서 이슈 제목, 렌더된 설명(HTML), 상위 이슈 정보를 가져와 이슈 본문을 자동 구성합니다.
    • 기존 이슈/PR 중 중복 항목을 검사해 중복 생성을 방지하고, 생성된 이슈 링크를 Jira에 남깁니다.
  • 정리(Chores)

    • 기존 GitHub→Jira 이슈 생성 워크플로우를 제거했습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Walkthrough

브랜치 생성 이벤트에서 브랜치명으로부터 Jira 이슈 키를 추출해 Jira API로 요약·렌더된 설명을 조회하고, 중복 검사를 거쳐 GitHub 이슈를 생성한 뒤 해당 GitHub 이슈 링크를 Jira 이슈에 댓글로 남기는 워크플로우가 추가되었고, 기존의 GitHub 이슈 기반 Jira 생성 워크플로우는 삭제되었습니다.

Changes

Cohort / File(s) Summary
Removed Workflow
.github/workflows/create-jira-issue.yml
GitHub 이슈 생성 시 Jira 이슈 및 브랜치 생성하던 워크플로우 전체 삭제 (삭제: 102줄).
New Workflow
.github/workflows/create-github-issue-from-jira-branch.yml
브랜치 생성 이벤트에서 브랜치명으로부터 Jira 키 추출(정규식 ([A-Z][A-Z0-9]+-[0-9]+)), Jira REST API로 summary, 렌더된 description, parent.key 조회, jq로 파싱, 기존 이슈/PR 중복 검사 후 새 GitHub 이슈 생성 및 Jira에 이슈 링크 댓글 추가하는 워크플로우 추가 (추가: 210줄). contents: read, issues: write 권한 요구, Jira 비밀값(JIRA_BASE_URL, JIRA_API_TOKEN, JIRA_USER_EMAIL) 사용, job concurrency 및 브랜치 이벤트 필터링 포함.

Sequence Diagram(s)

sequenceDiagram
    participant Branch as Branch 생성 (Git)
    participant GH_Actions as GitHub Actions
    participant Jira as Jira REST API
    participant GitHub as GitHub Search/Issues API

    Branch->>GH_Actions: 브랜치 생성 이벤트 (ref_type=branch)
    GH_Actions->>GH_Actions: 브랜치명에서 Jira 키 추출 (정규식)
    alt 키 없음
        GH_Actions->>GH_Actions: jira_key 출력 빈값, 작업 종료(스킵)
    else 키 존재
        GH_Actions->>Jira: GET /issue/{KEY}?expand=renderedFields
        Jira-->>GH_Actions: summary, rendered description, parent.key
        GH_Actions->>GitHub: Search issues/PRs for KEY (중복 검사)
        GitHub-->>GH_Actions: 검색 결과
        alt 중복 존재
            GH_Actions->>GitHub: 이슈 생성 및 Jira 댓글 생략
        else 중복 없음
            GH_Actions->>GitHub: Create Issue [KEY] {SUMMARY} (body 포함)
            GitHub-->>GH_Actions: Issue URL/번호
            GH_Actions->>Jira: POST comment with Issue URL
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

chore

Suggested reviewers

  • marulog
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning PR 제목 '지라 세팅'은 변경사항의 실질적 내용과 맞지 않습니다. 실제로는 기존 워크플로우를 제거하고 새로운 GitHub Actions 워크플로우를 추가하는 구체적인 변경이 있습니다. PR 제목을 더 구체적으로 변경하세요. 예: 'Reverse Jira automation workflow direction' 또는 'Replace issue-triggered workflow with branch-triggered workflow'
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch OT-18-feature-test-issue-created

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/create-github-issue-from-jira-branch.yml (1)

20-22: Jira 키 정규식을 기존 자동화와 맞춰 주세요.

여기서는 ([A-Z][A-Z0-9]+-[0-9]+)를 쓰지만, .husky/commit-msg.github/workflows/close-jira-issue.yml[A-Z]+-[0-9]+를 기준으로 키를 추출합니다. 지금처럼 패턴이 다르면 이 워크플로가 만든 이슈 제목의 키를 닫기 워크플로가 다시 읽지 못하는 경우가 생깁니다.

정규식 일관성 맞추기
-          if [[ "$BRANCH_NAME" =~ ([A-Z][A-Z0-9]+-[0-9]+) ]]; then
+          if [[ "$BRANCH_NAME" =~ ([A-Z]+-[0-9]+) ]]; then
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/create-github-issue-from-jira-branch.yml around lines 20 -
22, The branch-to-Jira-key regex currently used when extracting BRANCH_NAME into
BASH_REMATCH (pattern `([A-Z][A-Z0-9]+-[0-9]+)`) differs from the other
workflows; update the pattern to use the same Jira-key format `[A-Z]+-[0-9]+` so
the echo "jira_key=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT" produces keys
compatible with `.husky/commit-msg` and the `close-jira-issue.yml` workflow;
adjust the conditional that tests BRANCH_NAME (the regex in the if [[
"$BRANCH_NAME" =~ ... ]]) to use `[A-Z]+-[0-9]+`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 58-63: The heredoc uses a fixed delimiter "EOF" which can collide
with user-provided DESCRIPTION_HTML; instead generate a unique delimiter (e.g.,
DELIM=$(uuidgen) or a timestamp/random suffix), export or set it locally, and
use it in the heredoc invocation (description_html<<"$DELIM") and its terminator
to safely write DESCRIPTION_HTML to $GITHUB_OUTPUT; reference the existing
variables SUMMARY, DESCRIPTION_HTML and GITHUB_OUTPUT and replace the fixed
"EOF" usage with the generated DELIM so the heredoc opener and closer match and
cannot appear inside DESCRIPTION_HTML.
- Around line 73-79: Search currently only checks body for the JIRA_KEY marker
(variable jiraKey) when calling github.rest.search.issuesAndPullRequests, so
duplicates in titles or other formats are missed; update the query string q to
search both title and body for the marker and the plain Jira key (use in:title
and in:body with both "JIRA_KEY: ${jiraKey}" and "${jiraKey}") so duplicates are
detected in either title or body before creating a new issue.

---

Nitpick comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 20-22: The branch-to-Jira-key regex currently used when extracting
BRANCH_NAME into BASH_REMATCH (pattern `([A-Z][A-Z0-9]+-[0-9]+)`) differs from
the other workflows; update the pattern to use the same Jira-key format
`[A-Z]+-[0-9]+` so the echo "jira_key=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
produces keys compatible with `.husky/commit-msg` and the `close-jira-issue.yml`
workflow; adjust the conditional that tests BRANCH_NAME (the regex in the if [[
"$BRANCH_NAME" =~ ... ]]) to use `[A-Z]+-[0-9]+`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eb552111-800d-420f-a731-c778f49f5a88

📥 Commits

Reviewing files that changed from the base of the PR and between 4bededb and 1ac842c.

📒 Files selected for processing (2)
  • .github/workflows/create-github-issue-from-jira-branch.yml
  • .github/workflows/create-jira-issue.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/create-jira-issue.yml

Comment thread .github/workflows/create-github-issue-from-jira-branch.yml
Comment thread .github/workflows/create-github-issue-from-jira-branch.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
.github/workflows/create-github-issue-from-jira-branch.yml (1)

79-88: ⚠️ Potential issue | 🟠 Major

중복 판정이 아직도 현재 생성 포맷에 과하게 묶여 있습니다.

Line 79는 Jira 키가 들어간 이슈를 넓게 찾지만, Line 85-87은 제목이 정확히 [KEY]로 시작하거나 본문에 JIRA_KEY: 마커가 있는 경우만 기존 이슈로 인정합니다. 그래서 수동 생성 이슈나 이전 포맷 이슈처럼 제목/본문에 Jira 키만 들어있는 경우에는 같은 Jira 키로 새 이슈를 또 만들 수 있습니다.

수정 예시
             const existing = result.data.items.find((item) =>
               !item.pull_request &&
-              (item.title.startsWith(`[${jiraKey}]`) || item.body?.includes(marker))
+              (
+                item.title?.includes(jiraKey) ||
+                item.body?.includes(marker) ||
+                item.body?.includes(jiraKey)
+              )
             );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/create-github-issue-from-jira-branch.yml around lines 79 -
88, The duplicate-detection is too strict: while the search q uses the jiraKey,
the existing check only accepts titles that startWith(`[${jiraKey}]`) or bodies
containing marker, so issues with the jiraKey elsewhere in title/body are
missed. Update the existing detection (where result and existing are used) to
treat any non-pull-request item whose title or body contains the jiraKey
(case-insensitive) OR whose body contains marker as a duplicate; keep the
existing pull_request filter and preserve the original exact-startsWith check if
desired, but broaden to title?.includes(jiraKey) and body?.includes(jiraKey) to
avoid creating duplicate issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 118-127: The "브랜치명" section currently prints the computed
recommendedBranch (`recommendedBranch`) instead of the actual branch created by
the event; either replace `recommendedBranch` with the real branch variable used
by the workflow (e.g., `BRANCH_NAME` / the runtime branch ref) when building the
`body` array so the issue shows the actual created branch, or alternatively
change the heading text to "권장 브랜치명 (Recommended branch)" to reflect that the
value is only a suggestion; update the `body` element that currently contains ``
`${recommendedBranch}` `` accordingly and ensure any environment or action
output variable used (e.g., `BRANCH_NAME` or github.ref) is referenced
consistently.
- Around line 48-52: The API call that builds RESPONSE uses
fields=summary,description but then reads .fields.parent.key into PARENT_KEY, so
update the request URL (the call using
"${JIRA_BASE_URL}/rest/api/3/issue/${JIRA_KEY}?fields=...") to include parent in
the fields query (e.g., fields=summary,description,parent) so PARENT_KEY (and
any parent data) is returned; adjust only the fields parameter in the request
that sets RESPONSE so SUMMARY, DESCRIPTION_HTML and PARENT_KEY work correctly.

---

Duplicate comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 79-88: The duplicate-detection is too strict: while the search q
uses the jiraKey, the existing check only accepts titles that
startWith(`[${jiraKey}]`) or bodies containing marker, so issues with the
jiraKey elsewhere in title/body are missed. Update the existing detection (where
result and existing are used) to treat any non-pull-request item whose title or
body contains the jiraKey (case-insensitive) OR whose body contains marker as a
duplicate; keep the existing pull_request filter and preserve the original
exact-startsWith check if desired, but broaden to title?.includes(jiraKey) and
body?.includes(jiraKey) to avoid creating duplicate issues.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4962f189-8a02-4139-b2d5-88742870329b

📥 Commits

Reviewing files that changed from the base of the PR and between 1ac842c and 7ca6f6e.

📒 Files selected for processing (1)
  • .github/workflows/create-github-issue-from-jira-branch.yml

Comment thread .github/workflows/create-github-issue-from-jira-branch.yml Outdated
Comment thread .github/workflows/create-github-issue-from-jira-branch.yml Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 68-95: The deduplication (search -> create) is not atomic and can
race; split the workflow into two jobs: an extract_jira_key job that runs the
existing extract step and sets outputs.jira_key, and a follow-up
create_github_issue job (which runs the dedup/search and create logic currently
in the same file, including the step id dedup and outputs 'exists'/'number')
that declares needs: extract_jira_key and a concurrency section such as
concurrency.group: jira-issue-${{ needs.extract_jira_key.outputs.jira_key }} to
serialize runs for the same Jira key; this ensures the github-script search in
the dedup step cannot be run in parallel with another run for the same key and
prevents duplicate issue creation.
- Around line 45-48: The two curl invocations that populate RESPONSE (the
command using "${JIRA_BASE_URL}/rest/api/3/issue/${JIRA_KEY}?...") and the other
curl around lines 188-194 lack connection and overall timeouts and retries;
update both curl calls to include sensible timeouts (e.g., --connect-timeout and
--max-time) and limited retry behavior (e.g., --retry, --retry-delay,
--retry-connrefused) so the workflow doesn't hang indefinitely, while preserving
the existing -sS --fail and authentication headers and existing failure
handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d43adcb4-09b4-48d8-a0c0-38d1a323b084

📥 Commits

Reviewing files that changed from the base of the PR and between 7ca6f6e and fa87f14.

📒 Files selected for processing (1)
  • .github/workflows/create-github-issue-from-jira-branch.yml

Comment thread .github/workflows/create-github-issue-from-jira-branch.yml
Comment thread .github/workflows/create-github-issue-from-jira-branch.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/create-github-issue-from-jira-branch.yml (1)

21-25: 보안 모범 사례: github.event.ref를 환경 변수로 전달하세요.

${{ github.event.ref }}run: 블록에서 직접 보간하면 이론적으로 쉘 주입 위험이 있습니다. Git 브랜치 이름 제약으로 실제 악용은 어렵지만, 환경 변수를 사용하는 것이 더 안전합니다.

♻️ 환경 변수 사용 예시
       - name: Extract Jira key from branch name
         id: extract
         shell: bash
+        env:
+          REF_NAME: ${{ github.event.ref }}
         run: |
-          BRANCH_NAME="${{ github.event.ref }}"
+          BRANCH_NAME="$REF_NAME"
           if [[ "$BRANCH_NAME" =~ ([A-Z][A-Z0-9]+-[0-9]+) ]]; then
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/create-github-issue-from-jira-branch.yml around lines 21 -
25, Replace direct interpolation of ${{ github.event.ref }} inside the run block
with an environment variable and reference that variable in the shell to avoid
shell-injection risks: set an env like BRANCH_REF: ${{ github.event.ref }} in
the job/step env, then in the run script use BRANCH_NAME="$BRANCH_REF" (and keep
the existing BASH_REMATCH extraction and echo to GITHUB_OUTPUT for jira_key and
branch_name) so the code uses the environment variable instead of direct
workflow expression interpolation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/create-github-issue-from-jira-branch.yml:
- Around line 21-25: Replace direct interpolation of ${{ github.event.ref }}
inside the run block with an environment variable and reference that variable in
the shell to avoid shell-injection risks: set an env like BRANCH_REF: ${{
github.event.ref }} in the job/step env, then in the run script use
BRANCH_NAME="$BRANCH_REF" (and keep the existing BASH_REMATCH extraction and
echo to GITHUB_OUTPUT for jira_key and branch_name) so the code uses the
environment variable instead of direct workflow expression interpolation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: aa15626f-c0c2-4ad0-8125-85aec4f4f439

📥 Commits

Reviewing files that changed from the base of the PR and between fa87f14 and 21f1599.

📒 Files selected for processing (1)
  • .github/workflows/create-github-issue-from-jira-branch.yml

@arlen02-01 arlen02-01 merged commit 623fee8 into develop Apr 10, 2026
1 check 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