-
Notifications
You must be signed in to change notification settings - Fork 731
Migrate from GitHub support repo to Jira support board #2731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request introduces a comprehensive transition from GitHub to Jira issue reporting across multiple backend services and configuration files. The changes include updating configuration structures, renaming database columns, modifying service implementations, and adapting type definitions to support Jira integration. The modifications span configuration files, database migrations, service implementations, and type definitions to enable Jira-based issue reporting functionality. Changes
Sequence DiagramsequenceDiagram
participant Client
participant DataIssueService
participant JiraAPI
Client->>DataIssueService: Create Data Issue
DataIssueService->>JiraAPI: Get Auth Token
JiraAPI-->>DataIssueService: Return Token
DataIssueService->>JiraAPI: Create Issue
JiraAPI-->>DataIssueService: Return Issue Details
DataIssueService-->>Client: Confirm Issue Creation
Possibly related PRs
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🔭 Outside diff range comments (1)
services/apps/webhook_api/src/routes/dataIssue.ts (1)
Line range hint
1-10
: Update webhook handling to support Jira instead of GitHubThe code currently uses GitHub-specific webhook verification and configurations:
import verifyGithubWebhook from 'verify-github-webhook' import { GITHUB_ISSUE_REPORTER_CONFIG } from '../conf'Since migrating to Jira, update the webhook handling to use Jira's webhook mechanisms and configurations.
🧹 Nitpick comments (7)
backend/src/services/dataIssueService.ts (5)
25-30
: Correct the typo in the interface nameIJireAPIAuthTokenResponse
The interface name
IJireAPIAuthTokenResponse
appears to have a typo. It should beIJiraAPIAuthTokenResponse
for consistency and clarity.
32-43
: Ensure consistency in interface naming for JiraSimilarly, verify that the interface
IJiraCreateIssueResponse
is correctly named and consistent with Jira naming conventions.
103-103
: Address the TODO regarding issue type selectionThere is a TODO comment to consult with @joana about the issue type:
// todo: ask @joana if we should use any other issue type
Please follow up to determine if a different issue type should be used to ensure correct categorization in Jira.
Would you like assistance in selecting the appropriate issue type or opening a Jira ticket to track this task?
145-148
: Improve error handling by logging error detailsWhen failing to obtain the Jira access token, the caught error is not logged:
} catch (error) { throw new Error('Failed to obtain Jira access token') }Consider logging the error for better debugging:
} catch (error) { this.log.error({ error }, 'Failed to obtain Jira access token') throw new Error('Failed to obtain Jira access token') }
147-148
: Clarify error message for accurate contextThe error message 'Error during session create!' may not reflect the actual operation that failed. Update it to more accurately describe the error, such as 'Error creating Jira issue'.
services/libs/types/src/dataIssues.ts (1)
23-28
: Correct the typo in the interface nameIJireIssueReporterConfiguration
The interface name
IJireIssueReporterConfiguration
seems to have a typo. It should beIJiraIssueReporterConfiguration
for consistency.backend/src/conf/index.ts (1)
123-124
: Maintain consistent spacing between exportsAdd a newline before the export to maintain consistency with other configuration exports in the file.
export const GITHUB_ISSUE_REPORTER_CONFIG: IGithubIssueReporterConfiguration = config.get<IGithubIssueReporterConfiguration>('githubIssueReporter') + export const JIRA_ISSUE_REPORTER_CONFIG: IJireIssueReporterConfiguration = config.get<IJireIssueReporterConfiguration>('jiraIssueReporter')
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
backend/config/custom-environment-variables.json
(1 hunks)backend/src/conf/index.ts
(2 hunks)backend/src/database/migrations/U1734432927__changeGithubIssueUrlToIssueUrl.sql
(1 hunks)backend/src/database/migrations/V1734432927__changeGithubIssueUrlToIssueUrl.sql
(1 hunks)backend/src/services/dataIssueService.ts
(5 hunks)services/apps/webhook_api/src/routes/dataIssue.ts
(2 hunks)services/libs/data-access-layer/src/data_issues/index.ts
(4 hunks)services/libs/types/src/dataIssues.ts
(2 hunks)
✅ Files skipped from review due to trivial changes (2)
- backend/src/database/migrations/V1734432927__changeGithubIssueUrlToIssueUrl.sql
- backend/src/database/migrations/U1734432927__changeGithubIssueUrlToIssueUrl.sql
🔇 Additional comments (4)
backend/src/services/dataIssueService.ts (1)
86-87
: Question necessity of Base64 decoding for clientSecret
The clientSecret
is being decoded from Base64:
Buffer.from(JIRA_ISSUE_REPORTER_CONFIG.clientSecret, 'base64').toString('utf8')
Is there a specific reason for storing clientSecret
in Base64 and decoding it here? If not required, consider storing it securely without encoding to simplify the code.
services/apps/webhook_api/src/routes/dataIssue.ts (1)
52-52
:
Verify the webhook payload structure for Jira
The code references data.issue.html_url
, which is specific to GitHub. Confirm that Jira's webhook payload provides this property or update it to use the correct Jira field for the issue URL.
To verify, review Jira's webhook documentation or inspect a sample payload to ensure correct property usage.
services/libs/data-access-layer/src/data_issues/index.ts (1)
13-13
: LGTM!
The renaming of githubIssueUrl
to issueUrl
and updates to related functions are correctly implemented.
Also applies to: 29-29, 80-83
backend/config/custom-environment-variables.json (1)
133-138
: Verify Jira configuration completeness
The Jira configuration includes essential fields for integration. However, please verify:
- Whether these are all the required fields for Jira Cloud API integration
- If additional optional fields might be needed (e.g.,
issueType
,labels
)
Also, consider adding documentation comments above this section to describe the required environment variables and their purposes.
Run this script to check Jira Cloud API requirements:
✅ Verification successful
Let me gather more specific information about the Jira integration implementation.
Let me check the Jira integration type definition to understand the required configuration fields.
Based on the findings, I can now provide the final response:
Jira configuration is complete and matches type definition
The configuration in custom-environment-variables.json
perfectly matches the IJireIssueReporterConfiguration
interface requirements from services/libs/types/src/dataIssues.ts
. All required fields are present:
apiUrl
clientId
clientSecret
projectKey
No additional fields are needed as these match the exact interface definition used by the application. The configuration is sufficient for the Jira Cloud API integration.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify if all required Jira Cloud API fields are configured
# Check if there are any Jira-related code that might need additional configuration
rg -l 'jira|JIRA' --type ts --type js
# Look for Jira API usage patterns that might indicate missing configuration
ast-grep --pattern 'new JiraClient($$$)' || ast-grep --pattern 'JiraApi($$$)'
Length of output: 2558
Script:
#!/bin/bash
# Check Jira integration implementation details
rg -A 10 "jiraIssueReporter" backend/src/
# Check configuration usage
cat backend/src/conf/index.ts
# Look for Jira API calls to understand required fields
rg -A 5 "jira.*api" --type ts --type js
Length of output: 7663
Script:
#!/bin/bash
# Check Jira integration type definition
rg -A 10 "IJireIssueReporterConfiguration" services/libs/types/src/
rg -A 10 "interface.*Jira" services/libs/types/src/
# Check actual Jira integration implementation
rg -A 15 "createJiraIssue|reportJiraIssue" backend/src/
Length of output: 540
…nto migrate/LFX-1777
Changes proposed ✍️
What
copilot:summary
copilot:poem
Why
How
copilot:walkthrough
Checklist ✅
Feature
,Improvement
, orBug
.Summary by CodeRabbit
Release Notes
New Features
apiUrl
,clientId
,clientSecret
, andprojectKey
.Bug Fixes
Refactor
Documentation