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

Adds detection logging messages at info level #344

Merged
merged 2 commits into from
May 18, 2023
Merged

Adds detection logging messages at info level #344

merged 2 commits into from
May 18, 2023

Conversation

pivotal-david-osullivan
Copy link
Contributor

Summary

This PR adds additional logging when Detect returns false for this buildpack. This is to provide more information about why the detection failed for this buildpack when verbose/debug logging is enabled.

As of lifecycle v1.16.0, if the detect phase fails as a whole, log messages are printed at info level by default, without the need for the verbose flag.

Use Cases

A pack build command with the --verbose flag set will show these log statement if detection fails. If Detect succeeds, the output is not shown unless --verbose is set.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@pivotal-david-osullivan pivotal-david-osullivan added type:enhancement A general enhancement semver:patch A change requiring a patch version bump labels May 17, 2023
@pivotal-david-osullivan pivotal-david-osullivan requested a review from a team as a code owner May 17, 2023 11:37
Copy link
Contributor

@dmikusa dmikusa left a comment

Choose a reason for hiding this comment

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

A few comments...

  1. Same as on the other related PRs, what do you think about passing a logger to libpak.NewConfigurationResolver so that we see the env variable state when there's an issue? Seems like it could be helpful.
  2. Line 88. Do you think it would make sense to add a log statement there? It's not a case that would cause the buildpack to skip, but it does cause a difference in behavior with the buildpack. Maybe it would be helpful to log something there.

@pivotal-david-osullivan
Copy link
Contributor Author

  1. Thanks - I added this, it's only useful if there are env-vars as part of the detection but we shouldn't have a config-resolver if there are none.
  2. I added this too for extra info

@dmikusa dmikusa merged commit 652e006 into main May 18, 2023
@dmikusa dmikusa deleted the detect-logging branch May 18, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants