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

refactor: opt-in for non-reproducible builder options #121

Merged
merged 14 commits into from
Apr 23, 2023

Conversation

drahnr
Copy link
Contributor

@drahnr drahnr commented Apr 15, 2023

Makes sure build_time and build_host are opt-in.

Not clear, if there is a reason to keep cookie. We're a lib, and as such that's more a design choice for the user of the library than us.

Ref #117

@drahnr drahnr force-pushed the bernhard-builder-opt-in branch 3 times, most recently from 7476076 to 1e6f698 Compare April 15, 2023 14:08
Copy link
Collaborator

@cmeister2 cmeister2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of thoughts

src/rpm/compressor.rs Outdated Show resolved Hide resolved
src/rpm/builder.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
src/tests/fut.rs Outdated Show resolved Hide resolved
src/rpm/builder.rs Outdated Show resolved Hide resolved
src/rpm/builder.rs Outdated Show resolved Hide resolved
@dralley
Copy link
Collaborator

dralley commented Apr 18, 2023

@drahnr Let's do a new release after we finish up + merge this PR and the payloaddigest one.

@drahnr drahnr requested a review from dralley April 18, 2023 07:31
src/compat_tests.rs Outdated Show resolved Hide resolved
src/rpm/builder.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
src/rpm/builder.rs Outdated Show resolved Hide resolved
@drahnr drahnr requested a review from dralley April 19, 2023 08:29
.add_changelog_entry("me", "was awesome, eh?", 123_123_123)
.add_changelog_entry("you", "yeah, it was", 12_312_312)
.add_changelog_entry(
"me",
Copy link
Collaborator

@dralley dralley Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the standard packaging guidelines for the author value, which means

FirstName LastName <email> - VersionAndRelease

The description should start with -

So for the changelog entry (in a specfile)

%changelog
* Tue May 31 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.1-1
- First bello package
- Example second

The date would go to date, "Adam Miller <maxamillion@fedoraproject.org> - 0.1-1" would go to "author", and

- First bello package
- example second item in the changelog for version-release 0.1-1

would be the description

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well for the tests it doesn't matter much, but I mean for examples and such

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that needs some more refinement, why would we make the version suffix - 0.1-1 part of the author? It appears the API is not quite there and I'd like to carve that out in a separate PR.

@dralley
Copy link
Collaborator

dralley commented Apr 21, 2023

@drahnr After that ^^ this is good to merge

@drahnr
Copy link
Contributor Author

drahnr commented Apr 22, 2023

@drahnr After that ^^ this is good to merge

I don't necessarily want to change the API in this PR, which imho is necessary. I changed the author and added - prefixes in public API, but don't want to introduce any further changes in this PR, that will continue to feature creep.

@dralley
Copy link
Collaborator

dralley commented Apr 22, 2023

I don't think we need to change the API. It's weird, I agree, but the fact is that the data is actually stored together under the same IndexTag, and other libraries like createrepo_c keep them together in the API.

What you could do is change author to changelogname or something less specific and add a bit to the documentation so that it's not as confusing. I don't think there's anything wrong with the "changelog name" containing a release identifier.

drahnr and others added 3 commits April 22, 2023 17:15
Co-authored-by: Daniel Alley <dalley@redhat.com>
/// ```
pub fn add_changelog_entry<A, E, TZ>(
mut self,
author: A,
Copy link
Collaborator

@dralley dralley Apr 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. you could put something along these lines (feel free to reword) in the doc comment

Convention is to have one changelog entry per release. The changelog name should be comprised of the first and last name of the release publisher, followed by their email address inside angle brackets, followed by a hyphen separator, followed by the version identifier of the release. Changes within the release should be listed in a bulleted list, one-per-line, using a hyphen character as a bullet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And rename the parameter

Suggested change
author: A,
changelogname: N,

@drahnr
Copy link
Contributor Author

drahnr commented Apr 22, 2023

The entire API here is just quirkesque. I'll create a separate PR to straighten this with a separate type that exposes a proper builder pattern.

@dralley
Copy link
Collaborator

dralley commented Apr 22, 2023

I don't think it's terribly quirky tbh, it's in line with what any other library does.

@drahnr
Copy link
Contributor Author

drahnr commented Apr 22, 2023

I don't think it's terribly quirky tbh, it's in line with what any other library does.

It's not idiomatic Rust, it's not intuitive for anyone using it the first time and issues are only encountered with other libraries validating the changelog format. That is bad UX and should be avoided where possible.

@drahnr drahnr requested a review from dralley April 23, 2023 09:12
@dralley
Copy link
Collaborator

dralley commented Apr 23, 2023

Failing test

@drahnr
Copy link
Contributor Author

drahnr commented Apr 23, 2023

Failing test

Fixed

@dralley dralley merged commit b30d026 into master Apr 23, 2023
@dralley dralley deleted the bernhard-builder-opt-in branch April 23, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants