Giter Club home page Giter Club logo

changie's People

Contributors

abhinav avatar adi611 avatar adlotsof avatar cassiobotaro avatar cosmastech avatar dependabot[bot] avatar edgarrmondragon avatar eltociear avatar emmyoop avatar frassle avatar fredbi avatar gennadyspb avatar github-actions[bot] avatar goreleaserbot avatar imgbot[bot] avatar jonatan5524 avatar katerberg avatar llaville avatar miniscruff avatar reitzig avatar rocktavious avatar thespyder avatar veyh avatar wizsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

changie's Issues

New command to get next release version based on part.

Is your feature request related to a problem? Please describe.
Is not a problem but can be useful a command changie next patch who echoes next version based on latest.

Describe the solution you'd like
Create a new command to echoes next release based on latest. (see additional context).

Describe alternatives you've considered
Add into batch command directly a conditional to check if "major", "minor" or "patch", get version using latest pipeline, then pass forward next version.

Additional context
image

Update website home page

Currently, it has parts of the readme and some features on it.
The features should be listed in the readme as well.
The website does not need the readme badges either.

"latest" command with no versions causes panic

If the changie latest command is run in a project that contains no versions, the command panics.

reproduction:

tmp=$(mktemp -d) && cd $tmp && changie init && changie latest; rm -rf $tmp

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/miniscruff/changie/cmd.latestPipeline(0x7bb040, 0x9a74d0, 0x74f6ab, 0x4, 0x74f64b, 0x4)
	/home/user/src/go/src/github.com/miniscruff/changie/cmd/latest.go:84 +0x785
github.com/miniscruff/changie/cmd.runLatest(0x971600, 0x9a74d0, 0x0, 0x0, 0x0, 0x0)
	/home/user/src/go/src/github.com/miniscruff/changie/cmd/latest.go:40 +0x3d
github.com/spf13/cobra.(*Command).execute(0x971600, 0x9a74d0, 0x0, 0x0, 0x971600, 0x9a74d0)
	/home/user/src/go/src/github.com/spf13/cobra/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0x971de0, 0x74f1a1, 0x1, 0x74f410)
	/home/user/src/go/src/github.com/spf13/cobra/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/user/src/go/src/github.com/spf13/cobra/command.go:895
github.com/miniscruff/changie/cmd.Execute(...)
	/home/user/src/go/src/github.com/miniscruff/changie/cmd/root.go:19
main.main()
	/home/user/src/go/src/github.com/miniscruff/changie/main.go:14 +0x9d

add init cli command to create basic folder structure

changie init will begin the process of initializing changie. The basic components are a "change" folder with a simple default. Add a basic template to the folder. Include a header template file. Create a changelog file with the basic template and "empty" release.

generate command

When preparing a new release we will need a new changelog file from our combined changes. changie generate with a required parameter of the new version.

Allow multiple lines for changelog entries

Problem and Use Case

At the moment, the body of a changelog entry cannot contain any newlines.
If you use "Upgrade Notice" or "Deprecated" kinds in your changelog, it is ofter required to write more than one sentence.
As Markdown (and YAML) allows line breaks in list items if they are indented correctly, Changie should also support such entries.

Suggestion

The body prompt for a new entry should be modified so a newline character is not interpreted as the end of the entry.
A specific character sequence (EOF or a dot) can be used instead of the newline character.

The resulting YAML file might look as follows:

kind: Removal
body: |
  This is the first,
  and this the second line!

init cmd creates directories with wrong permissions

I just gave this tool a try for the first time, and the first command I ran was changie init. The command failed with the following

$ changie init   
Error: mkdir changes/unreleased: permission denied

$ ls -ld ./changes
drw-r--r-- 2 user group 4096 Dec 28 12:46 ./changes

I can see that the wrong permissions are being used to create the non-existent directory (0644 instead of 0755)
3737ce6#diff-345cd3beb7d905a8bef99d83e99c62678bfd5101a26d30104ecc9320602072acR70

It is likely that this bug is not being caught because the tests use an in-memory afero filesystem which may not exercise the limits of the filesystem permissions.

Custom configurations per kind

This will probably need to be backward incompatible but it would be nice to allow for formatting and choices per kind.

Instead of:
kinds: [string of each kind]

It should be:

kinds:
  - label: prompt label
    header: header separate from label
  - repeat

Configurations at the top level are default to all kinds with the option to extend or override the defaults per kind.

Switch prompt tool to survey

promptui has a select and prompt feature but that is all.

https://github.com/AlecAivazis/survey has many more prompt options such as mutliline, confirm and multiselect.
I think moving to survey is going to be better regardless as it is in more active development.

The selection of prompt tool should not dictate much in changie, a small abstraction should work and can reduce the testing overhead of using stdin strings for stuff.
(TODO design the above)

use array of custom choices over a map

Maps are unordered and it is more common to see arrays of structs over a map in YAML files. Plus this will make testing consistent as arrays are ordered.

Create a logo

  • required for docs page
  • should be part of readme as a well
  • not sure if its part of GitHub settings or anything, but if so do that too

Create a discussion with each release of Changie

At least as a trial run to see if there are benefits to having one created.

From goreleaser docs:

  # If set, will create a release discussion in the category specified.
  #
  # Warning: do not use categories in the 'Announcement' format.
  #  Check https://github.com/goreleaser/goreleaser/issues/2304 for more info.
  #
  # Default is empty.
  discussion_category_name: General

For category name use "Release"

customizable generate blocks

In addition to storing custom fields, we will need to be able to customize how our change blocks are rendered. Probably an option in our config file.

A few examples

With all the configuration options it would be nice to have a few examples, probably an examples directory and a page on the website listing them all.

dry-run or latest only option

When creating new releases in GitHub ( and probably other tools ) you can add release notes directly to the release. This is probably identical or very similar to the generated output of changie. It would be very convenient if there was some connection between a GitHub release and a changie output. Maybe a GitHub action?

Remove afero as a dependency

Afero is used as a file abstraction in order for us to write tests, but writing tests with a temp directory is very easy so we should do that instead.

https://tip.golang.org/pkg/io/fs/
https://golang.org/pkg/testing/fstest/#MapFS to test

  • Remove afero as a dependency
  • Create interfaces for writing files as fs.FS does not include writing details. os has functions to write files though.
  • Create a struct to handle mocking writes for tests to extend the memfs but with write interfaces.

Custom domain

Use a custom domain ( already purchased ) for website

new change command

A simple cli prompt to generate new "change" files. Should store for now the date, time and body of a change. More will come later.

Add "edit page" button to docs

The theme used does not provide "Edit" or "Report" issues on pages, but it should not be too hard to include a footer or header to add links.

Add component section option

Add option for component headers.

So instead of:
header > kind > fragment

It can be:
header > component* > kind* > fragment
where both component and kinds are optional

Support for Batch Preambles

Problem and Use Case

The changelog keeps track of changes you made to your project and should help end-users and developers to understand which new features or breaking changes were introduced.
Changie combines different descriptions of changes together which will result in an overview for specific releases (tags).
Nevertheless it is sometimes a good idea, to describe your release/version in a few sentences so it is easier for other people to get an overview what the purpose of a release is without reading all specific changes.

Example:

## v1.2.3 (2021-04-05)

This release bundles a lot of new logging handler endpoints and an internal rework of the underlying log handling,
so it is recommended to check if another handler might able to increase the performance of your app.
[and a few sentences more]

### Added
- ...

### Fixed
- ...

Suggestion

One should be able to add an optional snippet/header if a new batch is created from unreleased fragments.
This might be implemented by providing a command line option which accepts a path to a file.
An interactive prompt is also a valuable option for short preambles.

Example Snippet:

This release bundles a lot of new logging handler endpoints and an internal rework of the underlying log handling,
so it is recommended to check if another handler might able to increase the performance of your app.
[and a few sentences more]

Changie CMD:

changie batch 1.2.3 --preamble path/to/file.md

support replacements in external files during merge

Updating the changelog file acts as the point of "this is a now a new version" but many projects have version fields in other places that should update at the same time. Some examples are package.json for javascript, setup.py for python packages, sphinx packages have a version value, etc. Goreleaser allows using ldflags as build parameters which can be injected from changie latest.

Configuration:

replacements:
- path: file/path.ext
  find: '  "version": ".*",' # regex search each line in file
  replace: '  "version": "{{.VersionNoPrefix}}",' # go template line replacement

For a javascript package.json:

{
  "name": "test-project",
  "version": "1.0.0",
  "description": "changie project",
  "main": "src/main.js",
}

Replace Struct:

type ReplaceData struct {
    Version string  // original version
    VersionNoPrefix string // no v prefix if version had it
}

new change support custom fields

When developing a project what aspects of changes are important will vary, therefore we should create a system to store and template custom fields.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.