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

Backport pr 12535 #12581

Closed
wants to merge 75 commits into from
Closed

Backport pr 12535 #12581

wants to merge 75 commits into from

Conversation

lbajolet-hashicorp
Copy link
Contributor

Backport of Packer init doc fixes #12535

lbajolet-hashicorp and others added 30 commits May 30, 2023 17:20
On HCP, multiproject support was GA'd recently, but Packer does not
support the feature yet.

To avoid clients being surprised if they encounter an error with this
feature enabled, we add an advisory related to this feature not being
supported for now, but planned for later.
With HCP supporting multi-projects now, Packer needs to take it into
account when picking a project from an organisation.

This commit adds two cases:

1. multiple projects are defined, none is supplied through
   HCP_PROJECT_ID: in this case we will default to the oldest project
   defined for the organisation.

2. we supply HCP_PROJECT_ID: in this case, we pick the project with the
   corresponding ID, and use it for publishing metadata.
* docs: add a paragraph on fingerprint generation

Since version 1.9.0+ changed the way Packer generates fingerprints for
HCP Packer, we add a small paragraph to explain how it used to be
generated before, and how it changed in this version.

* Apply suggestions from code review

---------

Co-authored-by: Wilken Rivera <wilken@hashicorp.com>
Remove the check-legacy-links-format.yml workflow. These checks are now included as part of our
content conformance checks that run on PRs with documentation content changes.
Packer will try to discover installed plugins in all of the directories
defined by packer.KnowPluginFolders. In a previous release logic was
added to scan nested directories in order to load plugins installed by
`packer plugins install`. This change resulted in a nested directory
scan for each folder within the KnownPluginFolders slice.

This change reduces the nested directory scan to only the directories
where plugins would have been installed using `packer plugins install`
* PACKER_PLUGIN_PATH takes precedence over all
#12476)

* Update external plugin documentation source

The Parallels plugin for Packer is now maintained by the Parallels team, under
their respective GitHub org. This changes updates the source address for
the external plugin that should be used for pulling new plugin
documentation.

* Removed packer-plugin-parallels for list of vendored plugins
Packer checks a number of directories for plugins upon initialization,
with the introduction of multi-component plugins and underlying changes
to the Packer SDK the ordering changed slightly. These changes update
the related documentation to reflect the new ordering, and adds a plugin
loading ordering section to the docs to help users discover how plugin
loading works.

Include in this change are updates to the PACKER_CONFIG_DIR environment
variables to reflect the XDG base directory specification used as the
default Packer configuration directory layout.

* Update website/content/docs/configure.mdx
When the config file header was reworked, an erroneous link was
included and placed so close to the header that it was rendered verbatim
in the final documentation page.

By adding an extra empty line in between the anchor link and the header,
this renders correctly.
In HCL2, if a template contains a `required_plugins' block, but the
required plugins are not installed, we print a warning.

Prior to this commit, this was reported as an error once per missing
plugin, which was redundant.
This commit changes that by gathering all the missing plugins once, and
printing them as a bullet list, so the message isn't redundant anymore.
Since the `discoverExternalComponents' function was defined but not
called anywhere, it is dead code, and can be safely removed from the
codebase.
Since bundled plugins will be removed in an upcoming version of Packer,
this commit adds a new warning message whenever a template uses one such
plugin.

This warning has been implemented on build, validate, console and the
inspect subcommands.

In addition to warning about the upcoming change and potential issue
this will cause, this warning message proposes solutions to the user so
they know what they'll have to do in order not to rely on those bundled
plugins later.
When a legacy JSON template references built-in plugins, we add them to
the resulting template as a `required_plugins' block in HCL2.
The Makefile would check for executable files inside the Packer
repository, and produce errors if one was detected and not explicitely
whitelisted through the `EXECUTABLE_FILES' Makefile variable.

This check was introduced a while back to avoid having executable files
in the repository, but this check can be problematic sometimes because
of how it is written, namely when building the website, which causes a
lot of JS executable files to appear in the hierarchy, and in turn this
causes the shell expansion to fail because of the large number of
arguments.

Since this test is not necessary for Packer to build or test, and since
it implies that we have to maintain the whitelist regex, we remove it
from the Makefile.
Co-authored-by: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com>
Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com>
lbajolet-hashicorp and others added 19 commits August 4, 2023 13:30
Before
```
2023/08/05 00:42:13 iterationID set: {{{{} 'S'}} "01H71JA47BZPT0HV3VW06CPEG4"}
2023/08/05 00:42:13 iterationID set: {{{{} 'S'}} "01H71JA47BZPT0HV3VW06CPEG4"}
2023/08/05 00:42:13 iterationID set: {{{{} 'S'}} "01H71JA47BZPT0HV3VW06CPEG4"}

```

After
```
2023/08/05 00:36:14 iterationID set: "01H71HZ5NPH8RZ1DC1AEYGSZJ7"
2023/08/05 00:36:14 iterationID set: "01H71HZ5NPH8RZ1DC1AEYGSZJ7"
2023/08/05 00:36:14 iterationID set: "01H71HZ5NPH8RZ1DC1AEYGSZJ7"
```
…ging/honestly-thorough-cockatoo

This pull request was automerged via backport-assistant
…y-humble-mayfly

This pull request was automerged via backport-assistant
* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at https://hashi.co/license-faq, and details of the license at www.hashicorp.com/bsl.

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
…ywrite-settings/hugely-content-marmoset

This pull request was automerged via backport-assistant
…ity-terminology/weekly-fun-cricket

This pull request was automerged via backport-assistant
…y-bursting-shrimp

This pull request was automerged via backport-assistant
`packer init' is meant to be invoked on a template file or a directory.
This was described in the command-line help message as
`[template.pkr.hcl|folder]'.

Because this is encapsulated between square brackets, this could be
taken as an option instead of a positional, mandatory argument.

This commit changes the wording to adopt a similar convention as `packer
build', so the two are consistent in how they are invoked, and to avoid
mistaking this argument as optional.
The `packer init' command's wording was not clear, so it was changed in
a preceding commit, and this commit aims to add more details on how the
command is meant to be used, along with a simple example.
@lbajolet-hashicorp
Copy link
Contributor Author

Superseded by #12583

@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 issues.
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 Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants