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

Fix xrefs #402

Merged
merged 1 commit into from
Dec 30, 2021
Merged

Fix xrefs #402

merged 1 commit into from
Dec 30, 2021

Conversation

ncfavier
Copy link
Member

A temporary fix for points 1 and 2 of #303.

This is bad for many reasons:

  • only works for NixOS options. I don't even know how non-NixOS options are supposed to reference one another, and this might change anyway with the markdown conversion(?).
  • relies on heuristics for undoing the conversion between option names and XML ids, which will probably break at some point or for some weird edge cases.
  • hardcodes unstable as the channel to use in links. Otherwise we would need to pass the channel name along all the way to the render function, which requires some refactoring.
  • creates a temporary file containing the Lua filter for each call to render. I don't know enough Rust to figure out how to make the file persist between calls while still being deleted on exit. Also, maybe it would be better to ship those files (fix-xrefs.lua, flake_info.nix, packages-config.nix) in the flake_info package directly instead of using temporary files.

...but it should at least fix the immediate issue.

cc @jtojnar

@ncfavier ncfavier requested a review from ysndr December 30, 2021 14:47
@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request December 30, 2021 14:49 Inactive
@ncfavier
Copy link
Member Author

ncfavier commented Dec 30, 2021

Backend changes aren't propagated to elasticsearch for the automated deployments. I've triggered the nixpkgs import workflow on this branch manually now.

The rendered description for that option is

<rendered-docbook><p>Specify the rules for which files to read on the host. This is an advanced option. If you're looking to configure user keys, you can generally use <a href="https://search.nixos.org/options?channel=unstable&amp;show=users.users.&lt;name&gt;.openssh.authorizedKeys.keys&amp;query=users.users.&lt;name&gt;.openssh.authorizedKeys.keys">users.users.&lt;name&gt;.openssh.authorizedKeys.keys</a> or <a href="https://search.nixos.org/options?channel=unstable&amp;show=users.users.&lt;name&gt;.openssh.authorizedKeys.keyFiles&amp;query=users.users.&lt;name&gt;.openssh.authorizedKeys.keyFiles">users.users.&lt;name&gt;.openssh.authorizedKeys.keyFiles</a>. These are paths relative to the host root file system or home directories and they are subject to certain token expansion rules. See AuthorizedKeysFile in man sshd_config for details.</p>
</rendered-docbook>

Specify the rules for which files to read on the host. This is an advanced option. If you're looking to configure user keys, you can generally use users.users.<name>.openssh.authorizedKeys.keys or users.users.<name>.openssh.authorizedKeys.keyFiles. These are paths relative to the host root file system or home directories and they are subject to certain token expansion rules. See AuthorizedKeysFile in man sshd_config for details.

which looks correct. I've checked a few different cases manually myself.

@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request December 30, 2021 15:33 Inactive
@ncfavier
Copy link
Member Author

Just rebased on latest main containing b6f1dc9, which affects services.openssh.authorizedKeysFiles. Re-running the workflow now.

@github-actions
Copy link
Contributor

@github-actions github-actions bot temporarily deployed to pull request December 30, 2021 15:51 Inactive
@ncfavier
Copy link
Member Author

Hm, I bumped the VERSION file and it seems to have successfully imported the new options but the changes still aren't visible. Not sure how this works.

@ysndr
Copy link
Member

ysndr commented Dec 30, 2021

For what I can tell it's showing correctly here

Copy link
Member

@ysndr ysndr left a comment

Choose a reason for hiding this comment

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

Seems to work fine as far a s I can tell
Do we need to change something in the guess method whether to run pandoc or not?

@ncfavier
Copy link
Member Author

ncfavier commented Dec 30, 2021

Indeed. I don't really understand how the frontend connects to the backend.

EDIT: never mind, it's just that the version needs to match between frontend and backend, so only the latest deployment could see the changes.

@ncfavier
Copy link
Member Author

Do we need to change something in the guess method whether to run pandoc or not?

I don't think so

@ncfavier ncfavier merged commit 194ba6d into main Dec 30, 2021
@ncfavier ncfavier deleted the fix-xrefs branch December 30, 2021 23:29
@jtojnar
Copy link
Member

jtojnar commented Dec 31, 2021

Clicking the link changes the URL in the address bar but does not change the search until I refresh the page in Firefox. (Probably the same issue as back/forward browser buttons not working.)

@ncfavier
Copy link
Member Author

Opened #403

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