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(webhook): Don't log warning when secondary job queue is empty #3942

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

iainlane
Copy link
Contributor

@iainlane iainlane commented Jun 20, 2024

Right now the Terraform module is causing ${SQS_WORKFLOW_JOB_QUEUE} to be set to an empty string. Since we pass this through currently, and explicitly check for !== undefined - not any falsy value - we end up trying to send to an empty queue and logging a warning.

Doesn't break anything, but it's noisy in the logs.

Fix this by checking for any falsy value instead, and also using || instead of ?? when setting the variable in the first place, so an empty string ends up as undefined. Also, modify the testsuite to check for the SQS being created at all, since that happens earlier on and reproduces the failure.

This is a companion to #3943. This one stops the warning, and that one fixes the original cause by not setting the env var in the first place. Both could be merged, ideally.

Right now the Terraform module is causing `${SQS_WORKFLOW_JOB_QUEUE}` to be set
to an empty string. Since we pass this through currently, and explicitly check
for `!== undefined` - not any falsy value - we end up trying to send to an empty
queue and logging a warning.

Doesn't break anything, but it's noisy in the logs.

Fix this by checking for any falsy value instead, and also using `||` instead of
`??` when setting the variable in the first place, so an empty string ends up as
`undefined`. Also, modify the testsuite to check for the `SQS` being created at
all, since that happens earlier on and reproduces the failure.
@iainlane iainlane marked this pull request as ready for review June 20, 2024 11:13
@npalm npalm self-requested a review June 27, 2024 12:32
npalm pushed a commit that referenced this pull request Jun 27, 2024
…3943)

We currently indicate that this feature is disabled by setting the env
var to an empty string. But instead we could omit it, to avoid polluting
the environment, and causing a warning to be logged.

This is a companion to #3942. That one stops the warning mentioned, this
one fixes the original cause by not setting the env var in the first
place. Both could be merged, ideally.
Copy link
Member

@npalm npalm left a comment

Choose a reason for hiding this comment

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

Thanks looks all good

@npalm npalm merged commit ef25bd4 into philips-labs:main Jun 28, 2024
4 checks passed
npalm added a commit that referenced this pull request Jun 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[5.12.0](v5.11.0...v5.12.0)
(2024-06-28)


### Features

* add support for matcher config tiering options
([#3953](#3953))
([5f9d9eb](5f9d9eb))
* **lambda:** add option to define explicit lambda tags
([#3934](#3934))
([7e98943](7e98943))


### Bug Fixes

* **lambda:** bump braces from 3.0.2 to 3.0.3 in /lambdas
([#3944](#3944))
([1aef82b](1aef82b))
* **lambda:** bump the aws group across 1 directory with 2 updates
([#3955](#3955))
([2e094cf](2e094cf))
* **lambda:** bump the aws group across 1 directory with 6 updates
([#3949](#3949))
([76fe9af](76fe9af))
* **webhook:** Don't log warning when secondary job queue is empty
([#3942](#3942))
([ef25bd4](ef25bd4))
* **webhook:** Don't set `${SQS_WORKFLOW_JOB_QUEUE}` to empty string
([#3943](#3943))
([6c48dff](6c48dff))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: forest-releaser[bot] <80285352+forest-releaser[bot]@users.noreply.github.com>
Co-authored-by: forest-pr|bot <forest-pr[bot]@users.noreply.github.com>
Co-authored-by: Niek Palm <npalm@users.noreply.github.com>
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