pistacheio / pistache

A high-performance REST toolkit written in C++
https://pistacheio.github.io/pistache/
Apache License 2.0
3.17k stars 698 forks source link

ci: automatically update debian/changelog #1120

Closed Tachi107 closed 1 year ago

Tachi107 commented 1 year ago

This CI job will run when version.txt is updated in the master branch, and will push a new commit to the debian branch updating the changelog.

DEBFULLNAME and DEBEMAIL are set by "parsing" the control file. If you know a true debian/control parser that could be used instead, preferably part of dpkg or devscripts, please let me know.

This script currently only updates the single existing changelog entry. It could be possible to make it add a new entry each time instead, but it'd be a bit more involved and we would have to first check if it'd be compatible with our current PPA setup, which I personally don't know very well.

Closes #1119

codecov-commenter commented 1 year ago

Codecov Report

Base: 78.45% // Head: 78.60% // Increases project coverage by +0.14% :tada:

Coverage data is based on head (dc09f1a) compared to base (6938660). Patch has no changes to coverable lines.

:exclamation: Current head dc09f1a differs from pull request most recent head aa2c891. Consider uploading reports for the commit aa2c891 to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1120 +/- ## ========================================== + Coverage 78.45% 78.60% +0.14% ========================================== Files 53 53 Lines 6879 6879 ========================================== + Hits 5397 5407 +10 + Misses 1482 1472 -10 ``` | [Impacted Files](https://codecov.io/gh/pistacheio/pistache/pull/1120?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/common/transport.cc](https://codecov.io/gh/pistacheio/pistache/pull/1120?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2NvbW1vbi90cmFuc3BvcnQuY2M=) | `70.60% <0.00%> (+1.51%)` | :arrow_up: | | [include/pistache/transport.h](https://codecov.io/gh/pistacheio/pistache/pull/1120?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-aW5jbHVkZS9waXN0YWNoZS90cmFuc3BvcnQuaA==) | `60.00% <0.00%> (+6.25%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Tachi107 commented 1 year ago

Forgot to mention that this would also change how debian/changelog records the version. We currently only update it when bumping the major, minor or patch versions, while this updates and writes to it also when bumping the date. Is this OK for the PPA? If I recall correctly this shouldn't cause issues, and might even be better than before.

kiplingw commented 1 year ago

Hey @Tachi107. Nice job (again). You might want to try experimenting with the dctrl-tools package which I think can do exactly that - parse debian/control files.

But I think what you want to do is parse debian/changelog? In that case, you can do so like so:

$ dpkg-parsechangelog --show-field Version
0.1.1-1

I don't know if it will break in the PPA, but worst case is the Launchpad builder will let us know.

Tachi107 commented 1 year ago

I've looked at dctrl-tools, but what they do is extract the Maintainer field as-is, you cannot split it in two variables like DEBFULLNAME and DEBEMAIL. Not a big deal though, cut works fine.

And no, I don't need to extract the version from d/changelog, because I have to overwrite it with what's in version.txt