Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): ensure needsReload flag works #5211

Merged
merged 2 commits into from Oct 9, 2023
Merged

fix(core): ensure needsReload flag works #5211

merged 2 commits into from Oct 9, 2023

Conversation

eysi09
Copy link
Collaborator

@eysi09 eysi09 commented Oct 8, 2023

What this PR does / why we need it:

That's a function, not a boolean we were evaluating so it always returned true. This fixes that.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

That's a function, not a boolean we were evaluating so it always
returned true. This fixes that.
@eysi09 eysi09 requested a review from vvagaytsev October 8, 2023 17:28
@eysi09 eysi09 enabled auto-merge October 8, 2023 17:28
@eysi09 eysi09 added this pull request to the merge queue Oct 9, 2023
TimBeyer
TimBeyer previously approved these changes Oct 9, 2023
@@ -892,7 +892,7 @@ export class GardenServer extends EventEmitter {
} catch (error) {
errors.push(toGardenError(error))
} finally {
loadConfigLog.success(`Loading config failed with error: ${errors[0].message}`)
loadConfigLog.error(`Loading config failed with error: ${errors[0].message}`)
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it possible that errors is empty when the interpreter runs this line of code?
The finally block will run even when no error has been catched in this try/catch clause.

Copy link
Member

Choose a reason for hiding this comment

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

Is it possible that this line of code should be above the line 894?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, revoking my approval 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Haha on closer inspection this code doesn't make sense at all. I just noticed we were using success to print something that looked like an error but didn't look at the overall flow. My intention I was basically just to fix a typo.

I'll update though.

@stefreak stefreak removed this pull request from the merge queue due to a manual request Oct 9, 2023
@TimBeyer TimBeyer dismissed their stale review October 9, 2023 09:56

Steffen's request

@@ -236,7 +236,7 @@ export class GardenInstanceManager {

// Flag the instance for reloading when configs change
garden.events.once("configChanged", (_payload) => {
if (!garden.needsReload) {
if (!garden.needsReload()) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there possibly a linter rule that catches these kinds of bugs? @TimBeyer @eysi09

@eysi09 eysi09 added this pull request to the merge queue Oct 9, 2023
Merged via the queue into main with commit cdf65e3 Oct 9, 2023
42 checks passed
@eysi09 eysi09 deleted the fix-needs-reload branch October 9, 2023 15:13
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.

None yet

3 participants