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

pack: support .packignore #1096

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elhimov
Copy link
Contributor

@elhimov elhimov commented Feb 4, 2025

In some cases, there are files that may be useful, but should not be part of artifact. The ability to add files and directories to the .packignore file has been added, which allows you to ignore these files and directories when packing.

Closes #812

@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 5 times, most recently from f7a3cdc to 3c54756 Compare February 10, 2025 08:54
@elhimov elhimov marked this pull request as ready for review February 10, 2025 08:55
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from 3c54756 to 6e08a11 Compare February 10, 2025 09:00
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from 6e08a11 to f8132ea Compare February 11, 2025 09:57
@elhimov elhimov added the full-ci Enables full ci tests label Feb 11, 2025
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 3 times, most recently from 263b010 to 3054d90 Compare February 13, 2025 10:11
@elhimov elhimov requested a review from dmyger February 13, 2025 10:12
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from 3054d90 to 5b191c3 Compare February 13, 2025 10:27
@elhimov elhimov changed the title pack: support .packignore WIP: pack: support .packignore Feb 13, 2025
@elhimov elhimov marked this pull request as draft February 13, 2025 14:46
@elhimov elhimov changed the title WIP: pack: support .packignore pack: support .packignore Feb 13, 2025
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from 5b191c3 to 19aca8b Compare February 14, 2025 10:09
@elhimov elhimov marked this pull request as ready for review February 14, 2025 10:09
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 2 times, most recently from cefb7aa to d153b43 Compare February 17, 2025 13:59
@elhimov elhimov requested a review from oleg-jukovec February 17, 2025 14:02
@oleg-jukovec oleg-jukovec removed their request for review February 17, 2025 14:08
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from c6c2d85 to f434832 Compare February 19, 2025 07:24
cli/util/osfs.go Outdated
Comment on lines 9 to 15

func GetOsFS() fs.FS {
Copy link
Contributor

@oleg-jukovec oleg-jukovec Feb 19, 2025

Choose a reason for hiding this comment

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

Please, add a comment about problem being solved of the function. It is not clear why it is required for a reader out of the context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 2 times, most recently from 28cae6c to ef9e1ec Compare February 20, 2025 02:06
@elhimov elhimov requested a review from oleg-jukovec February 20, 2025 02:06
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from ef9e1ec to 5db42c2 Compare February 20, 2025 06:26
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 3 times, most recently from 2a350e4 to ac2a9c8 Compare February 20, 2025 15:02
@elhimov elhimov marked this pull request as draft February 20, 2025 20:05
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 2 times, most recently from 31e1920 to 4585ec5 Compare February 21, 2025 10:02
@elhimov elhimov marked this pull request as ready for review February 21, 2025 10:05
cli/util/util.go Outdated
@@ -1024,3 +1024,12 @@ func CollectWALFiles(paths []string) ([]string, error) {

return collectedFiles, nil
}

// Map is a generic slice mapper function.
func Map[T, V any](ts []T, fn func(T) V) []V {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes (see ignore_test.go)

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's put this code into the test code then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@elhimov elhimov requested a review from dmyger February 24, 2025 07:32
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from 4585ec5 to 3dcb739 Compare February 24, 2025 09:42
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 4 times, most recently from 9fff4bb to 0621983 Compare February 25, 2025 01:14
@elhimov
Copy link
Contributor Author

elhimov commented Feb 25, 2025

A few corrections have been applied:

  • Added comments in unit tests for better understanding of how they work
  • Added new unit tests
  • Fixed up the latest merged commit (there were duplicated entries in CHANGELOG)

@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from 0621983 to 44eb6ed Compare February 26, 2025 12:41
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch 2 times, most recently from 7b539ff to e14d838 Compare March 6, 2025 12:38
In some cases, there are files that may be useful, but should not
be part of artifact. The ability to add files and directories to
the .packignore file has been added, which allows you to ignore
these files and directories when packing.

Closes #812

@TarantoolBot document
Title: `tt pack` support `.packignore`

Use `.packignore` in the same way as `.gitignore` allows to exclude
unnecessary files while preparing application package with `tt pack
command.
@elhimov elhimov force-pushed the elhimov/gh-812-tt-pack-allow-to-ignore-paths branch from e14d838 to 3aa4384 Compare March 6, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-ci Enables full ci tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to ignore paths on artifact pack
4 participants