Skip to content

Conversation

@nitishfy
Copy link
Member

@nitishfy nitishfy commented Oct 22, 2025

The application controller code is written pretty nicely but hasn't been properly documented. There are quite a few fields that were deprecated too which is still getting used. This PR documents the app controller code, remove the deprecated function and add better logs.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Signed-off-by: nitishfy <justnitish06@gmail.com>
@nitishfy nitishfy requested a review from a team as a code owner October 22, 2025 07:44
@bunnyshell
Copy link

bunnyshell bot commented Oct 22, 2025

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

appList.Items = newItems
return appList, nil
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

deprecated.

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 78.68852% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.84%. Comparing base (05ccc01) to head (18aba50).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
controller/appcontroller.go 78.68% 12 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #25032      +/-   ##
==========================================
- Coverage   60.89%   60.84%   -0.05%     
==========================================
  Files         351      351              
  Lines       60489    60531      +42     
==========================================
  Hits        36832    36832              
- Misses      20736    20775      +39     
- Partials     2921     2924       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: nitishfy <justnitish06@gmail.com>
@nitishfy nitishfy requested a review from crenshaw-dev October 22, 2025 16:40
@nitishfy nitishfy requested a review from rumstead October 23, 2025 07:39
Copy link
Contributor

@ppapapetrou76 ppapapetrou76 left a comment

Choose a reason for hiding this comment

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

overall I'm, ok-ish with the logging but the comments inside the code are an anti-pattern
They explaining obvious code and if the code is not obvious we should improve the code vs adding inline comments

log.Infof("Initializing ApplicationController: appResyncPeriod=%v, appHardResyncPeriod=%v, appResyncJitter=%v", appResyncPeriod, appHardResyncPeriod, appResyncJitter)

db := db.NewDB(namespace, settingsMgr, kubeClientset)
// use default rate limiter config if not provided
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we really need this comment? It's apparent what the following line does.
Overall, if we need comments to explain the code, it's better to improve the code and remove the comments

log.Info("Hydrator feature enabled; initializing hydrator subsystem")
ctrl.hydrator = hydrator.NewHydrator(&ctrl, appResyncPeriod, commitClientset, repoClientset, db)
}
// Apply kubectl concurrency limit if specified
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here about comments

Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

I'm not sure why this PR is useful. Did you hear from users that exiting logging is not enough?

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.

5 participants