Skip to content

Conversation

@cbullinger
Copy link
Collaborator

  • Add Dockerfile to containerize the Node.js application
  • Add cronjobs.yml with weekly schedule and persistent volume for state tracking
  • Add .drone.yml CI/CD pipeline for build and deployment
  • Add check-last-run.js to prevent duplicate runs within 14-day window
  • Update index.js to integrate smart 14-day check logic
  • Update README.md with deployment documentation and monitoring instructions

The cronjob runs weekly but only collects metrics if 14+ days have passed, ensuring no data gaps while preventing duplicate collection.

- Add Dockerfile to containerize the Node.js application
- Add cronjobs.yml with weekly schedule and persistent volume for state tracking
- Add .drone.yml CI/CD pipeline for build and deployment
- Add check-last-run.js to prevent duplicate runs within 14-day window
- Update index.js to integrate smart 14-day check logic
- Update README.md with deployment documentation and monitoring instructions

The cronjob runs weekly but only collects metrics if 14+ days have passed,
ensuring no data gaps while preventing duplicate collection.
- Combine test, build, and deploy into one pipeline
- Remove unnecessary pipeline dependencies
- Simplify change detection logic
- Fix typo: DevOps -> DevDocs team in README
Copy link
Collaborator

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back to you with a handful of small Qs. Nothing blocking necessarily - I just want to make sure I understand correctly what we're doing here.

const STATE_FILE_PATH = process.env.STATE_FILE_PATH || '/data/last-run.json';

// Minimum days between runs
const MIN_DAYS_BETWEEN_RUNS = parseInt(process.env.MIN_DAYS_BETWEEN_RUNS || '14', 10);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this 13, instead? I'm wondering if any possibility of weirdness related to timing of test runs, etc. If it's only running on Monday and it's been close to 14 it should probably run.

import path from 'path';

// Path to the state file (mounted from persistent volume)
const STATE_FILE_PATH = process.env.STATE_FILE_PATH || '/data/last-run.json';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it looks like we're trying to read from process.env here but I don't see where we're setting these vars in the env setup?

}

// Write the state file
fs.writeFileSync(STATE_FILE_PATH, JSON.stringify(stateData, null, 2), 'utf8');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if there's any possibility of weirdness if the file already exists. Have you tested this manually with an extant file to ensure the behavior is correct - i.e. overwrites file contents? I'm wondering if we should remove the old file during the update func just for safety, or if that's overkill.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like overkill, esp for this tiny doc. @krollins-mdb does this align with common practice around writeFileSync()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants