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

Allow the whole commit object to be used as a field inside of a commit parser #757

Closed
1 task done
DerTiedemann opened this issue Jul 12, 2024 · 2 comments
Closed
1 task done
Assignees
Labels
feature/request New feature or request

Comments

@DerTiedemann
Copy link
Contributor

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

We are grouping our commit by labels on PRs and there is currently no easy way to group them and rename the groups based on regex.

Desired solution

I would love to just use any field in the commit object to group objects inside of the commit parsers, most prominently github.pr_labels. To be fair the easiest solution would to just add this as an option, but I think that would just kick the can along until someone decides they want a different label.

Alternatives considered

There is a workaround inside of the template definition itself, described here: #461 (comment)

Additional context

Original Implementation PR: #312

@DerTiedemann DerTiedemann added the feature/request New feature or request label Jul 12, 2024
Copy link

welcome bot commented Jul 12, 2024

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@DerTiedemann
Copy link
Contributor Author

DerTiedemann commented Jul 12, 2024

One idea to realisze this is to use the TeraContext which allows accessing values dynamically after the object has been serialized. As seen here. Though this would add a serialization cost for each commit, not sure if that would be an issue or not for such a niche feature. Also problematic would be the fact that the TeraContext does return a serde_json::Value which would be turned into a string and therefore would lose some accuracy regarding arrays for example. The workaround given above has to deal with that for example.

The TeraContext does not support the dotted syntax :<, but there is an impl for it, gonna have a look.
I see now why the limitation exists, the commits are parsed before they are poplulated with github information.

Apperantly you can just reorder the add_remote_data function to the begining and it just works (lol). Though there might be the issue that more commits are processed by the update_*_metadata functions, but for my repos, that did not make a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants