77const core = __nccwpck_require__(7484);
88
99// Rate limiting and retry constants
10- const RATE_LIMIT_DELAY = 500 ; // milliseconds between requests (increased from 100ms )
10+ const RATE_LIMIT_DELAY = 1500 ; // milliseconds between requests (increased to 1.5s )
1111const MAX_RETRIES = 3;
12- const RETRY_DELAY = 2000; // 2 second base delay for retries (increased from 1s)
13- const BATCH_SIZE = 5; // Process 5 flags at a time (reduced from 10 )
14- const BATCH_DELAY = 2000; // 2 second delay between batches (increased from 500ms )
12+ const RETRY_DELAY = 2000; // 2 second base delay for retries
13+ const BATCH_SIZE = 5; // Process 5 flags at a time (not used in sequential processing )
14+ const BATCH_DELAY = 2000; // 2 second delay between batches (not used in sequential processing )
1515
1616/**
1717 * Sleep utility function
@@ -120,12 +120,12 @@ async function run() {
120120 throw new Error(`Invalid days_from_creation value: ${daysFromCreationInput}. Must be a number between 1 and 365`);
121121 }
122122
123- core.info(`🚀 Starting LaunchDarkly Flag Expiry Setter`);
124- core.info(`📋 Project: ${projectKey}`);
125- core.info(`📅 Days from creation: ${daysFromCreation}`);
126- core.info(`🏷️ Custom property: ${customPropertyName}`);
127- core.info(`📊 Date format: ${dateFormat}`);
128- core.info(`⏭️ Skip existing: ${skipExisting}`);
123+ core.info(`Starting LaunchDarkly Flag Expiry Setter`);
124+ core.info(`Project: ${projectKey}`);
125+ core.info(`Days from creation: ${daysFromCreation}`);
126+ core.info(`Custom property: ${customPropertyName}`);
127+ core.info(`Date format: ${dateFormat}`);
128+ core.info(`Skip existing: ${skipExisting}`);
129129
130130 // 1. Fetch all flags with proper pagination/throttling
131131 const allFlags = await getAllFeatureFlags(apiKey, projectKey);
@@ -152,16 +152,16 @@ async function run() {
152152 }
153153
154154 // 4. Output comprehensive results
155- core.info(`\n📊 Final Summary:`);
156- core.info(`🔍 Total flags found: ${allFlags.length}`);
157- core.info(`⏭️ Flags skipped: ${flagsSkipped.length}`);
158- core.info(`✅ Successfully updated: ${results.updatedFlags.length}`);
159- core.info(`❌ Failed to update: ${results.failedFlags.length}`);
160- core.info(`📋 Total processed: ${results.totalProcessed}`);
155+ core.info(`\nFinal Summary:`);
156+ core.info(`Total flags found: ${allFlags.length}`);
157+ core.info(`Flags skipped: ${flagsSkipped.length}`);
158+ core.info(`Successfully updated: ${results.updatedFlags.length}`);
159+ core.info(`Failed to update: ${results.failedFlags.length}`);
160+ core.info(`Total processed: ${results.totalProcessed}`);
161161
162162 // Log skipped flags summary
163163 if (flagsSkipped.length > 0) {
164- core.info(`\n⏭️ Skipped flags breakdown:`);
164+ core.info(`\nSkipped flags breakdown:`);
165165 const skipReasons = {};
166166 flagsSkipped.forEach(flag => {
167167 const reason = flag.reason.includes('Already has') ? 'Already has expiry' : flag.reason;
@@ -255,7 +255,7 @@ async function getAllFeatureFlags(apiKey, projectKey) {
255255 const limit = 50; // LaunchDarkly API default
256256 let totalCount = null;
257257
258- core.info('🔍 Fetching all feature flags from LaunchDarkly...');
258+ core.info('Fetching all feature flags from LaunchDarkly...');
259259
260260 // eslint-disable-next-line no-constant-condition
261261 while (true) {
@@ -275,7 +275,7 @@ async function getAllFeatureFlags(apiKey, projectKey) {
275275 // Track progress for large datasets
276276 if (totalCount === null && data.totalCount) {
277277 totalCount = data.totalCount;
278- core.info(`📊 Found ${totalCount} total flags to process`);
278+ core.info(`Found ${totalCount} total flags to process`);
279279 }
280280
281281 if (data.items && data.items.length > 0) {
@@ -284,7 +284,7 @@ async function getAllFeatureFlags(apiKey, projectKey) {
284284
285285 // Progress logging
286286 const progress = totalCount ? `${flags.length}/${totalCount}` : flags.length;
287- core.info(`📋 Retrieved ${progress} flags`);
287+ core.info(`Retrieved ${progress} flags`);
288288
289289 // If we got fewer items than the limit, we've reached the end
290290 if (data.items.length < limit) {
@@ -300,7 +300,7 @@ async function getAllFeatureFlags(apiKey, projectKey) {
300300 }
301301 }
302302
303- core.info(`✅ Successfully retrieved ${flags.length} total flags`);
303+ core.info(`Successfully retrieved ${flags.length} total flags`);
304304 return flags;
305305}
306306
@@ -441,7 +441,7 @@ function filterFlagsNeedingExpiry(flags, customPropertyName, skipExisting) {
441441 const flagsToProcess = [];
442442 const flagsSkipped = [];
443443
444- core.info(`🔍 Filtering flags that need expiry dates...`);
444+ core.info(`Filtering flags that need expiry dates...`);
445445
446446 for (const flag of flags) {
447447 // Check if flag already has the custom property
@@ -474,7 +474,7 @@ function filterFlagsNeedingExpiry(flags, customPropertyName, skipExisting) {
474474 flagsToProcess.push(flag);
475475 }
476476
477- core.info(`📊 Filtering complete: ${flagsToProcess.length} to process, ${flagsSkipped.length} skipped`);
477+ core.info(`Filtering complete: ${flagsToProcess.length} to process, ${flagsSkipped.length} skipped`);
478478 return { flagsToProcess, flagsSkipped };
479479}
480480
@@ -531,17 +531,17 @@ async function processFlagsInBatches(flagsToProcess, apiKey, projectKey, customP
531531 };
532532
533533 if (flagsToProcess.length === 0) {
534- core.info('📋 No flags to process');
534+ core.info('No flags to process');
535535 return results;
536536 }
537537
538- core.info(`🚀 Processing ${flagsToProcess.length} flags sequentially`);
538+ core.info(`Processing ${flagsToProcess.length} flags sequentially`);
539539
540540 for (let i = 0; i < flagsToProcess.length; i++) {
541541 const flag = flagsToProcess[i];
542542 results.totalProcessed++;
543543
544- core.info(`📦 Processing flag ${i + 1}/${flagsToProcess.length}: ${flag.key}`);
544+ core.info(`Processing flag ${i + 1}/${flagsToProcess.length}: ${flag.key}`);
545545
546546 try {
547547 const result = await processSingleFlag(flag, apiKey, projectKey, customPropertyName, daysFromCreation, dateFormat);
0 commit comments