trigger nixops from panel #253

Merged
kiara merged 4 commits from kiara/fediversity:deploy-button into main 2025-03-19 10:09:07 +01:00
Owner

adds a deploy button to the panel form - covers the local part of #76.

As a workaround to pass info (from our user form) into nixops4 uses
environment variable DEPLOYMENT thru nix's
--extra-experimental-features configurable-impure-env.

adds a deploy button to the panel form - covers the local part of #76. As a workaround to pass info (from our user form) into nixops4 uses environment variable `DEPLOYMENT` thru nix's `--extra-experimental-features configurable-impure-env`.
kevin was assigned by kiara 2025-03-18 18:23:31 +01:00
lois was assigned by kiara 2025-03-18 18:23:31 +01:00
kiara force-pushed deploy-button from 9d99fc0c9b to 3886d2ea47 2025-03-18 18:26:22 +01:00 Compare
@ -44,0 +49,4 @@
submission = obj.parsed_value.model_dump_json()
# in dev we can use a relative path, for deployed versions we must explicitly
# specify our root flake as the directory to trigger nixops from, see #94.
cwd = os.getenv("REPO_DIR") or f"{os.getcwd()}/.."

Instead of polluting business logic with a conditional dealing with inessential details, let's instead set REPO_DIR in the devhell. Also don't grab the environment variable directly, but please go via config, where all of these knobs are defined in a central place, and will make the application error out early if not handled correctly.

Instead of polluting business logic with a conditional dealing with inessential details, let's instead set `REPO_DIR` in the devhell. Also don't grab the environment variable directly, but please go via config, where all of these knobs are defined in a central place, and will make the application error out early if not handled correctly.
Author
Owner

pushed an update for this

pushed an update for this
@ -44,0 +51,4 @@
# specify our root flake as the directory to trigger nixops from, see #94.
cwd = os.getenv("REPO_DIR") or f"{os.getcwd()}/.."
# FIXME: let the user specify these from the form (#190)
dummy_user = {

Why do we need the user here? In any case we can get it from the request context.

Why do we need the user here? In any case we can get it from the request context.

I've seen this comment Fediversity/Fediversity#190 (comment)

Do we strictly require that already merely to conclude the user story this implements? If we can avoid it let's not touch that part here.

I've seen this comment https://git.fediversity.eu/Fediversity/Fediversity/issues/190#issuecomment-4986 Do we strictly require that already merely to conclude the user story this implements? If we can avoid it let's not touch that part here.
Author
Owner

Fediversity/Fediversity#215/files indeed rendered initialUser a mandatory property there, unfortunately

https://git.fediversity.eu/Fediversity/Fediversity/pulls/215/files#diff-c959e516a3e7e73b06277e1352072cd290f6d96b indeed rendered `initialUser` a mandatory property there, unfortunately
Author
Owner

fwiw i have not checked whether this pixelfed cli command accepts empty values for these properties, or which of its flags are even considered mandatory

fwiw i have not checked whether [this pixelfed cli command](https://pixelfed.github.io/docs-next/running-pixelfed/cli-cheatsheet.html#user-create) accepts empty values for these properties, or which of its [flags](https://git.fediversity.eu/Fediversity/Fediversity/src/commit/8f0bcc35f0c0f5909215db7dea01b5ef8c2bc9a9/services/fediversity/pixelfed/default.nix#L158-L161) are even considered mandatory

Alright, please add this as an in-code comment so we don't lose track of it.

Alright, please add this as an in-code comment so we don't lose track of it.
kiara force-pushed deploy-button from 21f26ecfb8 to c5fe0157b0 2025-03-19 09:51:29 +01:00 Compare
simplify configuration via environment
All checks were successful
/ check-pre-commit (pull_request) Successful in 24s
/ check-website (pull_request) Successful in 9s
/ check-peertube (pull_request) Successful in 20s
/ check-pre-commit (push) Successful in 6s
/ check-website (push) Successful in 10s
/ check-peertube (push) Successful in 21s
afbbcbc22d
kiara merged commit afbbcbc22d into main 2025-03-19 10:09:07 +01:00
kiara deleted branch deploy-button 2025-03-19 10:09:08 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: fediversity/fediversity#253
No description provided.