-
-
Notifications
You must be signed in to change notification settings - Fork 137
Add meta.teams support #914
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
Conversation
d8a17dd
to
ffec7f1
Compare
I figured out a solution to the error. |
ffec7f1
to
f62fe36
Compare
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.
Intent is 👍 , one question about the code, haven't tested.
flake-info/src/data/export.rs
Outdated
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[allow(non_snake_case)] | ||
pub struct Team { | ||
members: Option<OneOrMany<Maintainer>>, |
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'm not super familiar with this codebase yet, but I wonder if it wouldn't be simpler for this to be a Vec
(or Option<Vec>
) here?
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.
Would be much simpler, yes. Specifically Option<OneOrMany<T>>
sounds like a complicated way to specify Vec<T>
. Perhaps it has benefits when (de-)serializing.
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.
Option<OneOrMany<T>>
is done in many other places so I used it because of that
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 had the impression that it is used in the contract between the 'nix side' and 'flake-info', but not between 'flake-info' and elasticsearch model - and that this struct is used for the latter. As said I'm not super familiar with this codebase yet, though, so I could be mistaken.
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.
Yeah, I'm not sure either. I think it does everything lol.
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.
is import.rs
the 'nix side' and export.rs
the 'elasticsearch side'?
my guess was that OneOrMany
would support both "foo"
and [ "foo" "bar" ]
due to nix being flexibly typed, but we can be a bit more strict on our 'own' side.
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 have no idea lol.
NixOS/nixpkgs#400458 was just merged, we should get this PR before it hits nixos-unstable and entries disappear from https://search.nixos.org. |
I'm not a huge fan of merging this feature without figuring out whether that How have you tested this change? |
I tried testing this with the |
I haven't tried testing it because idk how to test this and the README doesn't help. |
so it works even for teams that don't have GitHub teams
The page now shows "This package has no maintainers. If you find it useful, please consider becoming a maintainer!" in the "Maintainers" section when the package has no individual maintainers but only teams - that might be something to fix as well? |
I have proposed two fixes for this PR in RossComputerGuy#1 and RossComputerGuy#2 |
meta.teams support: show team name
meta.teams support: fix export
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.
let's give this a try 🤞
Doesn't work, got this error: |
can you PR an update changing the |
Oh, I can't right now... I can in about 6 hours. |
Fixes #907
We should get this close with NixOS/nixpkgs#400458.
My lack of experience with rust got me some progress but I couldn't get past this error:
So whoever reviews this needs to know Rust. We need
members
to be a list because that's what it is in Nix. But it doesn't returnOneOrMany
applied to the mapped list.