srid / nixci

Define and build CI for Nix projects anywhere; superceded by Omnix https://omnix.page/om/ci.html
GNU Affero General Public License v3.0
109 stars 5 forks source link

Change schema to allow alternative configurations #20

Closed ipetkov closed 1 year ago

ipetkov commented 1 year ago

Refs https://github.com/srid/nixci/issues/2 Refs https://github.com/srid/nixci/pull/13#issuecomment-1698336854

srid commented 1 year ago
pub fn flake_url(&self) -> String 

This function can be refactored to return a FlakeUrl type (newtype over String) which then impl's a method to get the attribute.

ipetkov commented 1 year ago

Instead of introducing a new indirection type (FlakeRefKind), I'd just modify the PulRequestRef type to take an additional struct field called anchor. Then, PullRequest::flake_url can construct a flake url that uses the anchor as attribute.

I've applied this feedback, let me know if you have anything else in mind!

This function can be refactored to return a FlakeUrl type (newtype over String) which then impl's a method to get the attribute.

I did not apply this feedback because it resulted in having to wrap the url String in multiple places only to unwrap it later and it did not seem like the boilerplate was adding much. But if you want this refactor done I can add it in

srid commented 1 year ago

@ipetkov This is fine. I just realized that there is more to it than FlakeUrl, so I'll take over this PR and merge it to mainline.