Skip to content

Added missing env variables in deployment manifest#133

Merged
kappsegla merged 1 commit intomainfrom
issue/132
Dec 19, 2025
Merged

Added missing env variables in deployment manifest#133
kappsegla merged 1 commit intomainfrom
issue/132

Conversation

@Deansie
Copy link
Collaborator

@Deansie Deansie commented Dec 19, 2025

Pull Request Type

  • Feature (a new feature for the project)
  • Fix (a bug fix)
  • Chore (no production code change)
  • Refactor (refactoring production code)
  • Docs (documentation changes)
  • Style (formatting only)
  • Test (adding/refactoring tests)

Description

This PR fixes deployment failures by adding required env vars to the Jenkinsfile-generated deployment.yaml. It resolves startup crashes from missing report cleanup configs (introduced in #114) and incomplete Google OAuth2 setup (from #89). No changes to app code, only pipeline config.

Key Features

  • Report Cleanup Configs – Adds REPORT_DELETEEXPIREDAFTERDAYS, CLEANUP_EXPIRE_CRON, and CLEANUP_DELETE_CRON to enable scheduled jobs without placeholder errors.
  • Google OAuth2 Prefixes – Adds SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_... vars to properly auto-configure ClientRegistrationRepository bean.
  • No Impact on Local Dev – Changes are prod-only (Kubernetes overrides); local runs unaffected.
  • Sensible Defaults – Values match test configs for quick stability.

How Has This Been Tested?

  • The creation of this PR introduces the first and only test by triggering the Jenkinsfile to run.

Linked issues

This PR closes issue #132

Summary by CodeRabbit

  • New Features

    • Integrated Google OAuth2 authentication provider, enabling users to securely authenticate using their Google accounts.
    • Implemented automated report cleanup and data retention management with a 30-day expiration threshold.
  • Chores

    • Updated deployment infrastructure configuration to support automated system maintenance and scheduled cleanup operations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Walkthrough

The pull request adds environment variables to the Kubernetes Deployment manifest generated by the Jenkinsfile. These additions configure Google OAuth2 client credentials (retrieved from a Kubernetes secret), OAuth2 scopes, and scheduled cleanup job settings for report expiration and deletion.

Changes

Cohort / File(s) Summary
Kubernetes Manifest Configuration
Jenkinsfile
Added environment variables for Google OAuth2 client ID, secret, and scope; added report expiration retention period and cleanup cron scheduling expressions to the Deployment container spec

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Verify Spring Security OAuth2 environment variable naming conventions are correct
  • Confirm Kubernetes secret reference (google-oauth2-credentials) and key names (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET) exist and are accurately referenced
  • Validate cron expression syntax for CLEANUP_EXPIRE_CRON and CLEANUP_DELETE_CRON
  • Review appropriateness of the 30-day report retention threshold

Possibly related issues

Possibly related PRs

Suggested reviewers

  • kappsegla
  • kikoDevv
  • Kirill9m
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue/132

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jenkins-cd-for-zipp
Copy link

Jenkins Build #1 Summary (for PR #133)

  • Status: SUCCESS
  • Duration: 1 min 38 sec
  • Branch: PR-133
  • Commit: dc0be0e
  • Docker Image: 192.168.0.82:5000/zipp:dc0be0e (pushed to registry)

Details:

  • Checkout: Successful
  • Build & Scan: Passed
  • Push: Successful

All stages passed—no issues detected.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
Jenkinsfile (1)

251-256: Cleanup configuration looks reasonable.

The values appear sensible:

  • 30-day retention period
  • Daily expiration check at midnight
  • Daily deletion at 2:30 AM

The cron expressions use 6-field Quartz format, which should work with Spring's @Scheduled annotation if that's what the application uses.

Consider parameterizing these values at the Jenkinsfile environment block (lines 10-39) for easier operational tuning without modifying the pipeline logic:

REPORT_DELETEEXPIREDAFTERDAYS = '30'
CLEANUP_EXPIRE_CRON = '0 0 * * * ?'
CLEANUP_DELETE_CRON = '0 30 2 * * ?'
OAUTH2_SCOPE = 'openid,profile,email'

Then reference them in the manifest:

-        - name: REPORT_DELETEEXPIREDAFTERDAYS
-          value: "30"
+        - name: REPORT_DELETEEXPIREDAFTERDAYS
+          value: "${REPORT_DELETEEXPIREDAFTERDAYS}"
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 080bd59 and dc0be0e.

📒 Files selected for processing (1)
  • Jenkinsfile (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: PR Build
  • GitHub Check: Jenkins
  • GitHub Check: Build, Test & Analyze
🔇 Additional comments (2)
Jenkinsfile (2)

249-250: The scope configuration is correct. Spring Boot supports comma-separated values for list properties in configuration, and comma-separated scope values like "openid,profile,email" are the standard format for Spring Security OAuth2 client registration. Environment variables can be used when binding to object lists, so this format will be properly parsed by Spring Boot without requiring spaces or alternative delimiters.


239-248: Verify if non-prefixed GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET (lines 224-233) are still used by application code.

The Spring-prefixed environment variables are correctly mapped. However, if the application has been fully migrated to Spring's OAuth2 auto-configuration, the non-prefixed variables on lines 224-233 may be redundant and should be removed. Only keep them if custom application code still references GOOGLE_CLIENT_ID or GOOGLE_CLIENT_SECRET directly.

@sonarqubecloud
Copy link

@kappsegla kappsegla merged commit 44dbd02 into main Dec 19, 2025
9 checks passed
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.

2 participants