nixos-search icon indicating copy to clipboard operation
nixos-search copied to clipboard

Make `description` an `Option<DocValue>` and implement markdown rendering.

Open ysndr opened this issue 3 years ago • 2 comments

It seems like this is due the the markdown transition in nixpkgs: option descriptions may now look like {"_type":"mdDoc","text":"..."}, which does not deserialise to Option<String>.

This was not supposed to be a problem until flakes started using lib.mdDoc, but, since we index _module.args for all flakes and that was given a markdown description in https://github.com/NixOS/nixpkgs/commit/e04a09082e33d444c245e1d5859b37ace25f54a9, things break for all flakes.

So, amusingly, https://github.com/NixOS/nixos-search/pull/528 fixes this issue, although that was not intended at all.

The proper fix, of course, is to make description an Option<DocValue> and implement markdown rendering.

~Also we should probably fail the CI job when no flakes are successfully imported.~ That wouldn't have caught this since flakes with no modules are still succeeding.

Originally posted by @ncfavier in https://github.com/NixOS/nixos-search/issues/534#issuecomment-1240357880

ysndr avatar Sep 08 '22 08:09 ysndr

Why do we need _reverse fields?

ncfavier avatar Sep 09 '22 12:09 ncfavier

That was some elasticsearch optimization if i recall correctly

ysndr avatar Sep 09 '22 13:09 ysndr