Hassio-Addons icon indicating copy to clipboard operation
Hassio-Addons copied to clipboard

[git-exporter] clean repo before proceeding

Open bjeanes opened this issue 2 years ago • 11 comments

After successive dry-runs, if exclude option is amended, now-excluded files will accumulate in the git directory with no real way to discard them.

Running git clean after clone will ensure a clean slate before re-rsyncing files over and git adding them.

bjeanes avatar May 11 '22 04:05 bjeanes

Use-case: I have Syncthing add-on enabled and had versioning turned on. This created a .stversions directory which was copied across before I excluded it. Once I moved legitimate secrets to the secrets.yaml, old versions in .stversions were being caught by the secrets scan and preventing commit.

Short of uninstalling the add-on to clear the data mount, this seems like the best course. It also seems to me that it would minimise the chance of accidental commits as the add-on config evolved.

bjeanes avatar May 11 '22 04:05 bjeanes

Or perhaps rsync --delete-excluded is sufficient here. I'm inclined to say that both are worthwhile, but what do you think?

bjeanes avatar May 11 '22 06:05 bjeanes

I would think a git clean should be sufficient after the clone. Cleaning old files is for sure something this addon was lacking. I will test it out, when I find some time and will merge it afterwards ;)

Can you please add an Changelog text with a new Minor-increased version?

Poeschl avatar May 13 '22 06:05 Poeschl

Hmm I didn't want to do changelog with a specific version or date because I don't yet know when it will be merged or released. And because I opened 2 PRs without knowing if one/both would be merged, a version bump would cause a conflict.

I can put today's date though and you can change it I suppose.

bjeanes avatar May 13 '22 07:05 bjeanes

I'm not sure what your Emoji scheme is in Changelog. It differs from https://github.com/favoloso/conventional-changelog-emoji which is the one I have seen before.

I see you've used 🔨, 🔧, and ➕ for similar changes in the past. How would you annotate this change?

bjeanes avatar May 13 '22 07:05 bjeanes

@bjeanes I would just use the hammer for it.

Seems that I need to think about a dev branch 😅 Hoped I don't need one for my free-time project.

Also looking into auto-generated Changelogs 😁

Poeschl avatar May 13 '22 07:05 Poeschl

Also looking into auto-generated Changelogs 😁

How I usually do this is that PRs must add changelog entries under an Unreleased changes heading and do NOT increment versions.

Then, as part of release/delpoy process, version is incremented, heading is renamed to version with current date, and a new empty "Unreleased changes" section is prepended to CHANGELOG.md.

Hope that helps. Personally, I think auto-generated changelogs are usually pretty hard as a user because they haven't been curated/worded for that audience. Manual changes are good, but having PRs bump versions can be hell when you have lots of concurrent PRs!

bjeanes avatar May 13 '22 07:05 bjeanes

@bjeanes I was thinking about some special tag, which can be attached to the commit message and contains a suitable user changelog message. 😉

Thanks for your input 😁

Poeschl avatar May 13 '22 07:05 Poeschl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 04 '22 03:06 stale[bot]

Shh bot, no time to review, but not stale 😅

Poeschl avatar Jun 04 '22 05:06 Poeschl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 12 '22 15:06 stale[bot]