smithy-security / smithy

The security workflow engine!
https://smithy.security
Apache License 2.0
73 stars 12 forks source link

Feature/440/changelog utility #441

Open northdpole opened 3 weeks ago

northdpole commented 3 weeks ago

close #440

sample output

[sg@sg changelog feature/440/changelog-utility*]$ go run main.go --repo-path `pwd` -patch -message="foobar" -current-tag='v0.56.4'
2024/11/01 17:49:33 INFO the latest annotated tag is tag=v0.56.4
2024/11/01 17:49:33 INFO working with commits=5
Tag 0.56.5 created at 7100c24555f665e58bb0ee86bbc3c5bf5de67209
## 0.56.5

**foobar**

2024-10-22T12:20:21+01:00: changelog binary that allows to generate a changelog consisting of commit messages between current HEAD and the last tag
2024-10-22T12:18:06+01:00: add changelog target to the makefile
2024-10-31T11:02:12Z: workaround defectdojo expecting a non-empty scanstarttime for their engagments
2024-10-30T14:57:59Z: fix #453 by providing an optional nvdApiKey to dependency-check
2024-10-31T11:02:12Z: workaround defectdojo expecting a non-empty scanstarttime for their engagments
coveralls commented 3 weeks ago

Pull Request Test Coverage Report for Build 11686575948

Details


Totals Coverage Status
Change from base Build 11684217196: 0.0%
Covered Lines: 3374
Relevant Lines: 8105

💛 - Coveralls
andream16 commented 3 weeks ago

Can you post a sample output?

northdpole commented 3 weeks ago

Can you post a sample output?

absolutely, here you go

``` $changelog --repo-path . --new-tag-name="v0.1.2.3" --new-tag-message="example changelog" ``` ``` ## v0.1.2.3 **example changelog** * changelog binary that allows to generate a changelog consisting of commit messages between current HEAD and the last tag * add changelog target to the makefile * Update reviewdog references to smithy. * Updating .gitignore to ignore smithy files previously ignored by ocurity. * Updating actions to leverage smithy references. * Updating tests to leverage smithy. * Updating lock. * Update README to replace ocurity with smithy. * Updating protobuf contracts to use smithy as reference. * Updating docs to use smithy references. * Updating examples to leverage smithy. ```
andream16 commented 3 weeks ago

Can you post a sample output?

absolutely, here you go

$changelog --repo-path . --new-tag-name="v0.1.2.3" --new-tag-message="example changelog"

## v0.1.2.3
**example changelog**

* changelog binary that allows to generate a changelog consisting of commit messages between current HEAD and the last tag

* add changelog target to the makefile

* Update reviewdog references to smithy.

* Updating .gitignore to ignore smithy files previously ignored by ocurity.

* Updating actions to leverage smithy references.

* Updating tests to leverage smithy.

* Updating lock.

* Update README to replace ocurity with smithy.

* Updating protobuf contracts to use smithy as reference.

* Updating docs to use smithy references.

* Updating examples to leverage smithy.

I think this looks good but I'd like to not have blank lines between each commit report.

It would also be cool to add a short timestamp to each commit, which can be helpful for debugging potential individual issues!

@northdpole

ptzianos commented 2 weeks ago

As far as I understand the logic, the workflow is that the user runs the utility with the new tag that they want to add and the script generates a list of commit messages since the latest tag (latest being the latest one based on the timestamps)

What happens if we release a new major version (v1.0.0) but until it's rolled out everywhere we release a patch version of the previous major tag (previous latest version v0.66.0 and we release v0.66.1). This utility would produce list of commit messages for the new tag v1.0.1 from v0.66.1 to now instead of from v1.0.0, right? I would expect it to use the current tag passed as a flag to figure out that closest one, and the closest one would be found based on just simple string sorting.

Also, I would expect that we could pass flags to just create a new major/minor/patch version based on the latest tag because that's the most common use case and it would allow us to remove the relevant make targets

northdpole commented 1 week ago

Can you post a sample output?

absolutely, here you go $changelog --repo-path . --new-tag-name="v0.1.2.3" --new-tag-message="example changelog"

## v0.1.2.3
**example changelog**

* changelog binary that allows to generate a changelog consisting of commit messages between current HEAD and the last tag

* add changelog target to the makefile

* Update reviewdog references to smithy.

* Updating .gitignore to ignore smithy files previously ignored by ocurity.

* Updating actions to leverage smithy references.

* Updating tests to leverage smithy.

* Updating lock.

* Update README to replace ocurity with smithy.

* Updating protobuf contracts to use smithy as reference.

* Updating docs to use smithy references.

* Updating examples to leverage smithy.

I think this looks good but I'd like to not have blank lines between each commit report.

It would also be cool to add a short timestamp to each commit, which can be helpful for debugging potential individual issues!

@northdpole

@andream16 , how about this?

## v0.1.2.3

**foobar**

2024-10-22T12:20:21+01:00: changelog binary that allows to generate a changelog consisting of commit messages between current 
HEAD and the last tag
2024-10-22T12:18:06+01:00: add changelog target to the makefile
2024-10-31T11:02:12Z: workaround defectdojo expecting a non-empty scanstarttime for their engagments