1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-13 11:17:26 +02:00
unleash.unleash/src/server-dev.ts
unleash-bot[bot] d2452b91f2
chore(AI): crDiffView flag cleanup (#10487)
This PR cleans up the crDiffView flag. These changes were automatically
generated by AI and should be reviewed carefully.

Fixes #10484



🧹 AI Flag Cleanup Summary

This PR removes the crDiffView feature flag and its associated legacy
components
for displaying changes in a Change Request. The flag has been enabled
and the
new diff view is now permanent.

This involved removing the feature flag from the configuration and code,
deleting several legacy components, and updating the components that
used them
to only use the new versions.

🚮 Removed

• Feature Flag Logic
• All checks for the crDiffView flag.
• The flag definition in uiConfig.ts, experimental.ts, and
server-dev.ts.
• Legacy Components
• LegacyStrategyChange.tsx
• StrategyTooltipLink.tsx
• LegacyReleasePlanChange.tsx
• SegmentTooltipLink.tsx
• LegacySegmentChangeDetails.tsx
• LegacyArchiveFeatureChange from ArchiveFeatureChange.tsx
• LegacyDependencyChange from DependencyChange.tsx
• LegacyToggleStatusChange from ToggleStatusChange.tsx

🛠 Kept

• New Components
• The new change request diff view components (StrategyChange,
ReleasePlanChange, etc.) are now used directly.
• The UI for displaying changes in a Change Request now consistently
uses
the improved diff view.

📝 Why

The crDiffView feature flag was deemed complete and ready for permanent
implementation. The cleanup follows standard procedure to remove the
flag and
associated dead code, simplifying the codebase and making it easier to
maintain.
This change makes the improved diff view for change requests the only
available
view.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-08-21 12:33:19 +02:00

95 lines
3.8 KiB
TypeScript

import { start } from './lib/server-impl.js';
import { createConfig } from './lib/create-config.js';
import { LogLevel } from './lib/logger.js';
import { ApiTokenType } from './lib/types/model.js';
process.nextTick(async () => {
try {
await start(
createConfig({
db: process.env.DATABASE_URL
? undefined
: {
user: 'unleash_user',
password: 'password',
host: 'localhost',
port: 5432,
database:
process.env.UNLEASH_DATABASE_NAME || 'unleash',
schema: process.env.UNLEASH_DATABASE_SCHEMA,
ssl: false,
applicationName: 'unleash',
},
server: {
enableRequestLogger: true,
baseUriPath: '',
// keepAliveTimeout: 1,
gracefulShutdownEnable: true,
// cdnPrefix: 'https://cdn.getunleash.io/unleash/v4.4.1',
enableHeapSnapshotEnpoint: true,
},
logLevel: LogLevel.debug,
secureHeaders: false,
versionCheck: {
enable: false,
},
experimental: {
// externalResolver: unleash,
flags: {
anonymiseEventLog: false,
responseTimeWithAppNameKillSwitch: false,
outdatedSdksBanner: true,
disableShowContextFieldSelectionValues: false,
feedbackPosting: true,
manyStrategiesPagination: true,
enableLegacyVariants: false,
extendedMetrics: true,
originMiddlewareRequestLogging: true,
webhookDomainLogging: true,
releasePlans: false,
showUserDeviceCount: true,
deltaApi: true,
uniqueSdkTracking: true,
strictSchemaValidation: true,
reportUnknownFlags: true,
customMetrics: true,
lifecycleMetrics: true,
impactMetrics: true,
paygTrialEvents: true,
lifecycleGraphs: true,
addConfiguration: true,
projectListViewToggle: true,
},
},
authentication: {
initApiTokens: [
{
environment: '*',
projects: ['*'],
secret: '*:*.964a287e1b728cb5f4f3e0120df92cb5',
type: ApiTokenType.ADMIN,
tokenName: 'some-user',
},
],
},
prometheusImpactMetricsApi: 'http://localhost:9090',
/* can be tweaked to control configuration caching for /api/client/features
clientFeatureCaching: {
enabled: true,
maxAge: 4000,
},
*/
}),
);
} catch (error) {
if (error.code === 'EADDRINUSE') {
// eslint-disable-next-line no-console
console.warn('Port in use. You might want to reload once more.');
} else {
// eslint-disable-next-line no-console
console.error(error);
process.exit();
}
}
}, 0);