Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: added support for dirty files #368

Merged
merged 11 commits into from
Sep 18, 2023
Merged

feat: added support for dirty files #368

merged 11 commits into from
Sep 18, 2023

Conversation

ga-shoaib-w
Copy link
Collaborator

No description provided.

@ga-shoaib-w ga-shoaib-w requested a review from ga-paul-t as a code owner August 17, 2023 16:17
@ga-shoaib-w ga-shoaib-w self-assigned this Aug 18, 2023
@ga-shoaib-w ga-shoaib-w linked an issue Aug 18, 2023 that may be closed by this pull request
1 task
docs/reference/config.md Outdated Show resolved Hide resolved
internal/git/utils.go Outdated Show resolved Hide resolved
docs/reference/config.md Outdated Show resolved Hide resolved
docs/reference/config.md Outdated Show resolved Hide resolved
Comment on lines 257 to 261
# Defines a list of files that uplift will ignore when checking the
# status of the current repository. If a change is detected that is
# not defined in this list, uplift will assume its default behaviour
# and fail due to the repository being in a dirty state
dirtyFiles:

Choose a reason for hiding this comment

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

I've generally found this change hard to understand from the naming and documentation. The text does not really tell me what happens with the 'dirtyFiles' are they only ignored or are they staged / committed by uplift. My assumption is that you want the Uplift to stage the files otherwise you could just add them to the .gitignore file? I feel the name of this config should describe what you want uplift to do with them. So if completely ignoring then maybe ignoreFiles, if staging then maybe stageFiles or addFiles or includeArtifacts (thinking build artifacts that you want in a 'release').

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like the name includeArtifacts - renaming it

Comment on lines 150 to 151
# Allowing specific case sensitive files to allow using uplift to
# add unedited but changed files as part of your CI

Choose a reason for hiding this comment

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

I don't think this is clear enough what the feature does, maybe an example of why it would be useful?
I also think we should update faq/gitdirty.md with how this feature can help.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will rewrite

# not defined in this list, uplift will assume its default behaviour
# and fail due to the repository being in a dirty state
dirtyFiles:
- file.txt

Choose a reason for hiding this comment

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

Should we allow Glob patterns? Can this be added later without breaking compatibility?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wouldnt like to introduce Glob patterns - only explicit files should only be allowed so users are aware of any extra files which shouldnt have changed

Comment on lines 258 to 260
# status of the current repository. If a change is detected that is
# not defined in this list, uplift will assume its default behaviour
# and fail due to the repository being in a dirty state

Choose a reason for hiding this comment

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

What about rewording to indicate why you would use this:

A list of case sensitive files that will be committed to the repo when the release is created.  Typically these files are managed as part of the release process e.g. generated by `hooks`.  This allows additional information to be included in a release such as a Software Bill Of Materials (SBOM) that is created by an external tool.   

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks - documentation is tough :D

An example usecase is if a file has been generated as part of your release e.g. software bill of materials which you wish to include in your versioning.

```yaml
Git:

Choose a reason for hiding this comment

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

Not sure if case sensitive, but to follow other docs this should have a lowercase 'g'

@ga-paul-t ga-paul-t merged commit 3b85254 into main Sep 18, 2023
@ga-paul-t ga-paul-t deleted the dirty-files branch September 18, 2023 12:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Allow dirty files through string array in config
3 participants