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

Refactor the repository layout #378

Merged
merged 90 commits into from
Dec 10, 2024
Merged

Conversation

mcdonnnj
Copy link
Member

@mcdonnnj mcdonnnj commented Oct 10, 2024

🗣 Description

Note

This is built on top of #376 because we need the updated version of cisagov/pre-commit-packer. The changes for just this pull request can be viewed at lineage/skeleton...improvement/refactor_repository

This pull request reformats the repository layout including breaking the Packer template into multiple files.

💭 Motivation and context

With the 0.1.0 release of cisagov/pre-commit-packer we can now use Packer templates that consist of more than one file. Breaking up this template will make it easier to maintain and modify. As part of that it makes sense to treat Packer projects more like Terraform root modules since both Packer and Terraform are Hashicorp projects that use the Hashicorp configuration language.

🧪 Testing

Automated tests pass.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • All new and existing tests pass.

Michael Saki and others added 30 commits February 14, 2024 12:59
This commit will make a few changes. The
orginal version of the semantic checking
function was a bit more difficult to read.
It is now somewhat easier to follow how
the regex is structured. Also the function
has been renamed to check_python_version
since it has 2 functions, making sure that
the version is semantically correct and the
second is to make sure that it is installed
on the user's machine. This makes it easier
to follow the logic for the flags, -p or
--python-version and -l or --list-versions
This commit will make a few changes. The
orginal version of the semantic checking
function was a bit more difficult to read.
It is now somewhat easier to follow how
the regex is structured. Also the function
has been renamed to check_python_version
since it has 2 functions, making sure that
the version is semantically correct and the
second is to make sure that it is installed
on the user's machine. This makes it easier
to follow the logic for the flags, -p or
--python-version and -l or --list-versions
Co-authored-by: dav3r <[email protected]>
Add the `check-useless-excludes` meta hook to verify that any defined
`exclude` directives apply to at least one file in the repository.
Instead of manually installing Packer we can instead leverage the
hashicorp/setup-packer Action just as we do for Terraform.
He is no longer a member of @cisagov/vm-dev.
Previously we only provided a lower bound for the version, but pinning to a specific version aligns with what has been done with the prettier hook and how pre-commit hooks are pinned in general.

The flake8-docstrings package is rarely updated, so there is no real downside to pinning to a specific version.

Co-authored-by: Nick <[email protected]>
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [crazy-max/ghaction-github-status](https://github.com/crazy-max/ghaction-github-status) from 3 to 4.
- [Release notes](https://github.com/crazy-max/ghaction-github-status/releases)
- [Commits](crazy-max/ghaction-github-status@v3...v4)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-status
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
This is done automatically with the `pre-commit autoupdate` command.
The pre-commit/mirrors-prettier hook was manually held back because the
latest tags are for alpha releases of the next major version.
Use the latest v3 release available from NPM.
…max/ghaction-github-status-4

Bump crazy-max/ghaction-github-status from 3 to 4
…s/cache-4

Bump actions/cache from 3 to 4
Use an Action to install Packer in our GitHub Actions workflows
…hon-version-checks

Add checks for correct semantic version of Python
The pip-audit tool will audit any supplied pip requirements files for
vulnerable packages.
…hook

Add the `check-useless-excludes` hook to the pre-commit configuration
…mmit_hook

Add a pre-commit hook to run `pip-audit`
mcdonnnj and others added 15 commits December 9, 2024 02:02
This aligns with what the src/ directory still contains.
This also requires us to replace any Packer commands that reference the
`packer.pkr.hcl` file to instead reference the directory that houses
the template (the root directory `.`).
Fix the link for variables in the template and update all references to
a Packer configuration to refer to a Packer template instead.
Add the `terraform-docs` configuration file and markers for where to
insert output in the README.
Now that we use `terraform-docs` to populate information about the
template's variables we do not need a manually managed table with that
information in the README.
Calling it `versions.pkr.hcl` aligns with how we name files in our
Terraform projects.
There is no reason to list each file if we can wildcard match on the
file extension.
@mcdonnnj mcdonnnj force-pushed the improvement/refactor_repository branch from c109dc1 to d862b89 Compare December 9, 2024 07:03
@jsf9k jsf9k added this pull request to the merge queue Dec 9, 2024
@jsf9k jsf9k removed this pull request from the merge queue due to a manual request Dec 9, 2024
@jsf9k jsf9k added this pull request to the merge queue Dec 9, 2024
@jsf9k jsf9k removed this pull request from the merge queue due to a manual request Dec 9, 2024
@jsf9k jsf9k added this pull request to the merge queue Dec 9, 2024
@jsf9k jsf9k removed this pull request from the merge queue due to a manual request Dec 9, 2024
@jsf9k jsf9k added this pull request to the merge queue Dec 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 9, 2024
@jsf9k jsf9k added this pull request to the merge queue Dec 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 10, 2024
@jsf9k jsf9k added this pull request to the merge queue Dec 10, 2024
Merged via the queue into develop with commit 6cefb69 Dec 10, 2024
13 checks passed
@jsf9k jsf9k deleted the improvement/refactor_repository branch December 10, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This issue or pull request involves changes to existing functionality documentation This issue or pull request improves or adds to documentation hacktoberfest-accepted Pull request that should count toward Hacktoberfest participation improvement This issue or pull request will add or improve functionality, maintainability, or ease of use kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release packer Pull requests that update Packer code
Projects
Development

Successfully merging this pull request may close these issues.

5 participants