-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support subflakes betterer #9
Conversation
required: true | ||
default: null | ||
mirrored-for: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we replace mirrored-for
, I think we'll also need to bump the nxfr version to v6 -- it's no longer in the meta (for obvious reasons), but was replaced by the repo
field which is the upstream repo e.g. in case you use NixOS/nixpkgs-subflake-lib
as the upload-name
.
Not the best solution, happy to rework it, but it "works".
@@ -87,7 +97,7 @@ impl NixfrPushCli { | |||
github_token.clone() | |||
} else { | |||
std::env::var("GITHUB_TOKEN") | |||
.wrap_err("Could not determine Github token, pass `--github-token`, or set either `NIXFR_PUSH_GITHUB_TOKEN` or `GITHUB_TOKEN`")? | |||
.wrap_err("Could not determine Github token, pass `--github-token`, or set either `NXFR_PUSH_GITHUB_TOKEN` or `GITHUB_TOKEN`")? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my god
a278b16
to
545f58e
Compare
545f58e
to
b38eecb
Compare
If you set the `upload-name` to whatever (i.e. `NixOS/nixos-subflake-lib`), set the `repo` to the actual GitHub repo (i.e. `NixOS/nixpkgs`), the `directory` (i.e. `./lib`), and finally the `git_root` (i.e. `.`) to get a nxfr tarball that contained only the Nixpkgs lib subflake. This replaces the old `mirrored-for` with the `repo` input, but also makes it more extensible / usable for e.g subflakes.
d225bd0
to
cf8d1b6
Compare
} else { | ||
Some(v) | ||
#[derive(Clone, Debug)] | ||
pub struct OptionString(pub Option<String>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use a function (clap says Fn(&str) -> Result<T, E>
would work), but clap threw an error about trying to downcast:
Message: Mismatch between definition and access of `tag`. Could not downcast to alloc::string::String, need to downcast to core::option::Option<alloc::string::String>
This was the next best thing, makes it so we get our None
s as early as possible (and now there's no way to mess it up by e.g. forgetting to convert).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bumped into this too before, super annoying.
@@ -163,14 +208,16 @@ impl NixfrPushCli { | |||
source = tracing::field::Empty, | |||
) | |||
)] | |||
#[allow(clippy::too_many_arguments)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit the clippy.toml
and set it to the right number :)
src/release_metadata.rs
Outdated
@@ -9,7 +9,7 @@ use crate::Visibility; | |||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] | |||
pub(crate) struct ReleaseMetadata { | |||
pub(crate) description: Option<String>, | |||
pub(crate) mirrored_for: Option<String>, | |||
pub(crate) repo: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require an update to nxfr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's https://github.com/DeterminateSystems/nxfr/pull/21.
Removing my approval as I want to see the PR based off this get merged to it first. |
…nxfr-and-nxfr-push-release-metadata Sort metadata, add mirrored param back
Co-authored-by: Ana Hobden <[email protected]>
If you set the
upload-name
to whatever (i.e.NixOS/nixos-subflake-lib
), set therepo
to the actual GitHub repo (i.e.NixOS/nixpkgs
), thedirectory
(i.e../lib
), and finally thegit_root
(i.e..
) to get a nxfr tarball that contained only the Nixpkgs lib subflake.This replaces the old
mirrored-for
with therepo
input, but also makes it more extensible / usable for e.g subflakes.todo: test that this works with existing repos (aka update configs and see if it still works)