feat: add log rotation env vars#563
Conversation
WalkthroughTwo new environment variables for delegated operation log handling are documented in Docker and Helm READMEs, with corresponding test case updates across six TestContainerEnv scenarios to validate expected container environment variable rendering. ChangesDelegated operation log environment variables
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/helm/api-deployment_test.go (1)
425-1206: ⚡ Quick winAdd one explicit override case for the new log env vars.
Current updates verify defaults in many scenarios, but not user-provided overrides. A dedicated case will catch template wiring regressions for these keys.
Proposed test-case addition
@@ func (s *deploymentApiTemplateTest) TestContainerEnv() { { + "overrideDoLogEnvVars", + map[string]string{ + "apiSettings.env.FIFTYONE_DO_LOG_BUCKET_PATH": "s3://bucket/prefix", + "apiSettings.env.FIFTYONE_DO_LOG_RETENTION_DAYS": "14", + }, + func(envVars []corev1.EnvVar) { + require.Contains(s.T(), envVars, corev1.EnvVar{ + Name: "FIFTYONE_DO_LOG_BUCKET_PATH", + Value: "s3://bucket/prefix", + }) + require.Contains(s.T(), envVars, corev1.EnvVar{ + Name: "FIFTYONE_DO_LOG_RETENTION_DAYS", + Value: "14", + }) + }, + }, + { "overrideExternalApiUrl", map[string]string{🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/helm/api-deployment_test.go` around lines 425 - 1206, Add a new test case inside TestContainerEnv that explicitly verifies user-provided overrides for the logging env vars (e.g. override "LOGGING_LEVEL" and "FIFTYONE_LOGGING_FORMAT"). Create a case (name like "overrideLogEnvVars") that sets the corresponding values in the values map (use the same prefix pattern as other overrides, e.g. "apiSettings.env.LOGGING_LEVEL": "DEBUG" and "apiSettings.env.FIFTYONE_LOGGING_FORMAT": "json"), then assert that the resulting envVars slice contains the updated values for LOGGING_LEVEL and FIFTYONE_LOGGING_FORMAT (match the JSON-based expectedEnvVar JSON pattern used by other cases in TestContainerEnv).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unit/helm/api-deployment_test.go`:
- Around line 425-1206: Add a new test case inside TestContainerEnv that
explicitly verifies user-provided overrides for the logging env vars (e.g.
override "LOGGING_LEVEL" and "FIFTYONE_LOGGING_FORMAT"). Create a case (name
like "overrideLogEnvVars") that sets the corresponding values in the values map
(use the same prefix pattern as other overrides, e.g.
"apiSettings.env.LOGGING_LEVEL": "DEBUG" and
"apiSettings.env.FIFTYONE_LOGGING_FORMAT": "json"), then assert that the
resulting envVars slice contains the updated values for LOGGING_LEVEL and
FIFTYONE_LOGGING_FORMAT (match the JSON-based expectedEnvVar JSON pattern used
by other cases in TestContainerEnv).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1b582b33-90f3-40f2-aace-e672acc7cf8c
⛔ Files ignored due to path filters (2)
helm/fiftyone-teams-app/values.schema.jsonis excluded by!**/*.jsonhelm/fiftyone-teams-app/values.yamlis excluded by!**/*.yaml
📒 Files selected for processing (3)
docker/README.mdhelm/fiftyone-teams-app/README.mdtests/unit/helm/api-deployment_test.go
|
@CamronStaley - is this intended to to be released with the next minor FiftyOne Enterprise release? |
|
@kevin-dimichel yes the changes that use these env vars are on develop and will go out in the release branch |
|
These were moved to OSS / FOE docs as discussed offline. If customers struggle to fine them then we will add back here |
Rationale
Logs are now stored in mongo for 30 days and then automatically rotated to a cloud path or deleted. If the path isn't provided they're just deleted. This PR exposes those values and documents them for customers.
These PRs need merged before these can be:
Review Priority
Changes
Document FIFTYONE_DO_LOG_BUCKET_PATH and FIFTYONE_DO_LOG_RETENTION_DAYS with a default of "None" and "30 days"
Checklist
Testing
unit tests
Related