Skip to content

command/views: Document and divide init JSON message types #37426

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

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Aug 11, 2025

I accept that omitting some of the message codes from the JSON messages may not have been the original intention but instead of nerd-sniping myself into changing it I am at least documenting the reality as I found it while documenting the init -json publicly in hashicorp/web-unified-docs#656

The documentation/descriptions may later be used in public-facing docs if we decide to use those message codes publicly.

Target Release

1.14.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@radeksimko radeksimko requested a review from a team as a code owner August 11, 2025 14:00
@radeksimko radeksimko added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Aug 11, 2025
@radeksimko radeksimko changed the title command/views: Document and divide JSON message types command/views: Document and divide init JSON message types Aug 11, 2025
LockInfo InitMessageCode = "lock_info"
DependenciesLockChangesInfo InitMessageCode = "dependencies_lock_changes_info"

//// Message codes below are ONLY used INTERNALLY (for now)
Copy link
Member

Choose a reason for hiding this comment

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

Just to check- does internally here mean that these messages are not (yet) documented in the machine readable output pages in the 'Internals' documentation? Or is it that the output from using -json does some selections of what is rendered in a machine readable way?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if it was intentional - hence my note in the PR description but generally I found that any InitMessageCode which is passed down to either PrepareMessage or Log (as opposed to Output practically turn the message into a JSON object which does not have that code anymore and instead have type set to the generic log.

init command generally also does not use go-hclog to emit these messages, which makes it different from how plan/apply JSON output is implemented - also something to reconsider.

My aim here was to get things documented at least though, not to necessarily fix anything (yet).

@radeksimko radeksimko merged commit 3b55d61 into main Aug 12, 2025
11 of 12 checks passed
@radeksimko radeksimko deleted the radek/f-cmd-init-json-docs branch August 12, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants