-
Notifications
You must be signed in to change notification settings - Fork 731
fix: sync GitHub disconnection to git integration [CM-675] #3384
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
@@ -1,6 +1,6 @@ | |||
# Global settings | |||
KUBE_MODE=1 | |||
CROWD_EDITION=community |
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.
This change is out of scope for this PR, but the default should be lfx to avoid inconsistent local/prod behavior
let insightsProject = null | ||
if (segmentId) { | ||
const [project] = await collectionService.findInsightsProjectsBySegmentId(segmentId) | ||
insightsProject = project | ||
} | ||
|
||
const { widgets } = await collectionService.findSegmentsWidgetsById(segmentId) | ||
let widgets = [] | ||
if (segmentId) { | ||
const widgetsResult = await collectionService.findSegmentsWidgetsById(segmentId) | ||
widgets = widgetsResult.widgets | ||
} | ||
|
||
const insightsRepo = insightsProject?.repositories ?? [] | ||
|
||
await deleteSegmentRepositories(qx, { | ||
segmentId, | ||
}) | ||
if (segmentId) { | ||
await deleteSegmentRepositories(qx, { | ||
segmentId, | ||
}) | ||
} |
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.
@ulemons For some reason, this fails locally due to missing segmentId
. I didn't investigate further, but the check seems to work. And from a quick test this isn't happening on staging/prod so I assume it has something to do with local setup
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.
i ll do a quick test in local env. btw do you make sense to do everything inside one if (segmentId) block ? maybe it is easier to read. what do you think ?
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.
approved, for me is working locally 👍
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.
Definitely makes sense 👍
It's fixed
Changes proposed ✍️
This pull request updates integration removal logic and environment configuration to better support the LFX Enterprise Edition and improve the handling of Git integrations. The main changes include switching the default edition to
lfx-ee
, enhancing the cleanup process for Git integrations, and improving robustness for segment-based operations.Edition and environment configuration:
CROWD_EDITION
in.env.dist.local
fromcommunity
tolfx-ee
, aligning the configuration with LFX Enterprise Edition requirements.Integration removal and Git integration handling:
IntegrationService
to always use the LFX logic, removing the previous edition check and ensuring consistent behavior.Robustness improvements for segment-based operations:
segmentId
before performing operations related to insights projects and widgets, preventing potential errors whensegmentId
is undefined.segmentId
is present, increasing code safety.Checklist ✅
Feature
,Improvement
, orBug
.