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

Ignore file support when finding buildpacks #673

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

colincasey
Copy link
Contributor

Previously we could rely on knowing that packaged buildpacks would be written to a location within the target directory configured in Crate. This was easy to determine through program code and could be supplied to find_buildpack_dirs so that packaged buildpacks weren't accidentally included when searching for buildpacks.

With the changes introduced in #583 it is no longer possible to easily determine the output location for packaged buildpacks. This PR adds the ignore crate to provide directory iteration that respects standard ignore files. This will give the user the ability to configure where we search within a project for buildpacks.

Related to #666

Previously we could rely on knowing that packaged buildpacks would be written to a location within the `target` directory configured in Crate. This was easy to determine through program code and could be supplied to `find_buildpack_dirs` so that packaged buildpacks weren't accidentally included when searching for buildpacks.

With the changes introduced in [#583](#583) it is no longer possible to easily determine the output location for packaged buildpacks. This PR adds the [ignore](https://crates.io/crates/ignore) crate to provide directory iteration that respects standard ignore files. This will give the user the ability to configure where we search within a project for buildpacks.
Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

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

Thank you for working on this!

libcnb-package/src/lib.rs Outdated Show resolved Hide resolved
libcnb-package/src/buildpack_dependency_graph.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@Malax Malax left a comment

Choose a reason for hiding this comment

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

My requested changes are the comments @edmorley made. ;-)

* updated error message
* using iterator instead of loop for finding buildpack dirs logic
* added a quick test to ensure that ignores work
* updated changelog entry
* updated error message
* using iterator instead of loop for finding buildpack dirs logic
* added a quick test to ensure that ignores work
* updated changelog entry
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@Malax Malax left a comment

Choose a reason for hiding this comment

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

Two small comments, otherwise: ship it!

CHANGELOG.md Outdated Show resolved Hide resolved
* updated test comments
* added PR link to changelog entry
@colincasey colincasey merged commit 31ec5af into main Sep 19, 2023
4 checks passed
@colincasey colincasey deleted the find_buildpacks_with_ignore branch September 19, 2023 15:00
colincasey added a commit that referenced this pull request Sep 19, 2023
* main:
  Ignore file support when finding buildpacks (#673)
  Apply rustfmt to README example (#676)
  Update example `cargo libcnb package` log output in READMEs (#675)
  Add CLI usage help output to libcnb-cargo README (#674)
  Fix lint errors with Rust 1.73 (#672)
  Include README.md in lib.rs (#667)

# Conflicts:
#	CHANGELOG.md
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.

3 participants