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

Add final sweeper error to logs #983

Merged
merged 3 commits into from Jun 15, 2022
Merged

Conversation

gdavison
Copy link
Contributor

If the sweeper framework returns an error, such as a missing sweeper dependency, the error is not displayed to the user.

...
2022/06/14 13:06:18 [DEBUG] Sweeper (aws_redshift_scheduled_action) already ran in region (us-west-2)
FAIL	github.com/hashicorp/terraform-provider-aws/internal/sweep	58.064s
FAIL
make: *** [sweep] Error 1

Now logs the error

...
2022/06/14 14:21:45 [DEBUG] Sweeper (aws_appconfig_configuration_profile) already ran in region (us-west-2)
2022/06/14 14:21:45 [ERROR] Sweeper (aws_docdb_global_cluster) has dependency (aws_docdb_cluster), but that sweeper was not found
FAIL	github.com/hashicorp/terraform-provider-aws/internal/sweep	60.860s
FAIL
make: *** [sweep] Error 1

@gdavison gdavison requested a review from a team as a code owner June 14, 2022 21:26
@bflad bflad added the bug Something isn't working label Jun 14, 2022
@bflad bflad added this to the v2.18.0 milestone Jun 14, 2022
@bflad bflad self-assigned this Jun 14, 2022
@bflad
Copy link
Member

bflad commented Jun 14, 2022

This makes sense to me if it is relating to when the "allow failures" flag is also set. Could you add a changelog entry as well? e.g. .changelog/983.txt and

```release-note:bug
helper/resource: Ensured errors are always logged when `-sweep-allow-failures` flag is set
```

@bflad bflad added the waiting-response An issue/pull request is waiting for a response from the community label Jun 14, 2022
@gdavison
Copy link
Contributor Author

gdavison commented Jun 14, 2022

No, --sweep-allow-failures isn't set and it's stopping at the first error, which is that the dependency doesn't exist. runSweeperWithRegion fails with an error, but gives no reason why

@bflad
Copy link
Member

bflad commented Jun 14, 2022

Fair enough -- changelog comment still applies, I guess more generically "helper/resource: Ensured sweeper errors are always logged"

Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

@bflad bflad removed the waiting-response An issue/pull request is waiting for a response from the community label Jun 15, 2022
@bflad bflad merged commit 4d7a266 into hashicorp:main Jun 15, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants