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

feat: migrate package create to slog #3132

Merged
merged 15 commits into from
Oct 25, 2024
Merged

feat: migrate package create to slog #3132

merged 15 commits into from
Oct 25, 2024

Conversation

mkcp
Copy link
Contributor

@mkcp mkcp commented Oct 23, 2024

Description

This PR:

  • Adds contributor QOL improvements:
    • sloglint
    • New formats: devslog (via --log-format="dev") and console-slog (via --log-format="console")
  • adds WithContext to packager.Packager and stores a context on it so we can log in its New() which has some load bearing logging. This is intended as a workaround.
  • Makes an empty log format, the default, --log-format="" == "none. So slog must be directly enabled.
  • Adds setup functions for both message and logger in cmd/root and feature flagging for disabling message and using logger.
    • When a log-format is provided, setupMessage() ensures PTerm output is discarded and sets the values for --no-progress, and --confirm.
  • Adds structured logging outputs throughout zarf package create
  • Marks TODOS on message calls in Create stating they're deprecated

Related Issue

Relates to #2576

Checklist before merging

@mkcp mkcp self-assigned this Oct 23, 2024
Copy link

netlify bot commented Oct 23, 2024

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 97e979c
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/671be675694a9c0008d167d9

@mkcp mkcp changed the title WIP: migrate package create to slog feat: migrate package create to slog Oct 24, 2024
@mkcp mkcp force-pushed the mkcp/slog-package-create branch 2 times, most recently from e7052c4 to 5fbe641 Compare October 24, 2024 02:01
mkcp added 11 commits October 24, 2024 16:29
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
…ng away from message on package create

Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
…sole-slog and console format

Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
@mkcp mkcp force-pushed the mkcp/slog-package-create branch from 3e3c88f to 7b387e8 Compare October 24, 2024 23:29
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Copy link

codecov bot commented Oct 24, 2024

@mkcp mkcp marked this pull request as ready for review October 24, 2024 23:48
@mkcp mkcp requested review from a team as code owners October 24, 2024 23:48
@AustinAbro321
Copy link
Contributor

You will need to edit cmd.Execute to slog an error message

mkcp and others added 2 commits October 25, 2024 11:00
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
@mkcp
Copy link
Contributor Author

mkcp commented Oct 25, 2024

Revisions applied - should be good to go. Just waiting on ci checks.

Signed-off-by: Kit Patella <kit@defenseunicorns.com>
@mkcp mkcp added this pull request to the merge queue Oct 25, 2024
Merged via the queue into main with commit 413b56c Oct 25, 2024
26 checks passed
@mkcp mkcp deleted the mkcp/slog-package-create branch October 25, 2024 19:32
Jneville0815 pushed a commit to radiusmethod/zarf that referenced this pull request Dec 12, 2024
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants