-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
[Gitar] Cleaning up stale feature flag: applicationOverviewNewQuery with value true #6956
Conversation
927e0a4
to
a46ddf5
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
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.
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 1 findings(s) ✅
if (!this.flagResolver.isEnabled('applicationOverviewNewQuery')) { | ||
return this.mapOldApplicationOverviewData(rows, existingStrategies); | ||
} |
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.
✅ Getting better: Complex Method
ClientApplicationsStore.mapApplicationOverviewData decreases in cyclomatic complexity from 15 to 14, threshold = 9
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.
✅ Code Health Quality Gates: OK
- Improving Code Health: 3 findings(s) ✅
private mapOldApplicationOverviewData( | ||
rows: any[], | ||
existingStrategies: string[], | ||
): IApplicationOverview { | ||
const featureCount = new Set(rows.map((row) => row.feature_name)).size; | ||
const missingStrategies: Set<string> = new Set(); | ||
|
||
const environments = rows.reduce((acc, row) => { | ||
const { | ||
environment, | ||
instance_id, | ||
sdk_version, | ||
last_seen, | ||
project, | ||
feature_name, | ||
strategies, | ||
} = row; | ||
|
||
if (!environment) return acc; | ||
|
||
strategies.forEach((strategy) => { | ||
if ( | ||
!DEPRECATED_STRATEGIES.includes(strategy) && | ||
!existingStrategies.includes(strategy) | ||
) { | ||
missingStrategies.add(strategy); | ||
} | ||
}); | ||
|
||
const featureDoesNotExist = !project && feature_name; | ||
|
||
let env = acc.find((e) => e.name === environment); | ||
if (!env) { | ||
env = { | ||
name: environment, | ||
instanceCount: instance_id ? 1 : 0, | ||
sdks: sdk_version ? [sdk_version] : [], | ||
lastSeen: last_seen, | ||
uniqueInstanceIds: new Set( | ||
instance_id ? [instance_id] : [], | ||
), | ||
issues: { | ||
missingFeatures: featureDoesNotExist | ||
? [feature_name] | ||
: [], | ||
}, | ||
}; | ||
acc.push(env); | ||
} else { | ||
if (instance_id) { | ||
env.uniqueInstanceIds.add(instance_id); | ||
env.instanceCount = env.uniqueInstanceIds.size; | ||
} | ||
if ( | ||
featureDoesNotExist && | ||
!env.issues.missingFeatures.includes(feature_name) | ||
) { | ||
env.issues.missingFeatures.push(feature_name); | ||
} | ||
if (sdk_version && !env.sdks.includes(sdk_version)) { | ||
env.sdks.push(sdk_version); | ||
} | ||
if (new Date(last_seen) > new Date(env.lastSeen)) { | ||
env.lastSeen = last_seen; | ||
} | ||
} | ||
|
||
return acc; | ||
}, []); | ||
environments.forEach((env) => { | ||
delete env.uniqueInstanceIds; | ||
env.sdks.sort(); | ||
}); | ||
|
||
return { | ||
projects: [ | ||
...new Set( | ||
rows | ||
.filter((row) => row.project != null) | ||
.map((row) => row.project), | ||
), | ||
], | ||
featureCount, | ||
environments, |
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.
✅ No longer an issue: Complex Method
ClientApplicationsStore.mapOldApplicationOverviewData is no longer above the threshold for cyclomatic complexity
@@ -301,9 +301,6 @@ export default class ClientApplicationsStore | |||
async getApplicationOverview( | |||
appName: string, | |||
): Promise<IApplicationOverview> { | |||
if (!this.flagResolver.isEnabled('applicationOverviewNewQuery')) { |
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.
✅ No longer an issue: String Heavy Function Arguments
The ratio of strings in function arguments is no longer above the threshold
Feature Flag Cleanup
Trigger
#6559 (comment)
Bot Commands
@gitar-bot cleanup stale_flag=value
will cleanup a stale feature flag. Replacestale_flag
with the name of the stale feature flag andvalue
with eithertrue
orfalse
.