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

improve installation experience #281

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft

improve installation experience #281

wants to merge 36 commits into from

Conversation

bash.bash:
- change `__can_read_decimal_timeout` to `BASH_CAN_READ_DECIMAL_TIMEOUT`
- add `BASH_CAN_*` capability variables, notably: `BASH_CAN_READ_I`, `BASH_CAN_PIPE_STDOUT_AND_STDERR_SHORTHAND`

bash.bash, zsh.zsh:
- fix `\m` being output instead of `\n` in `__print_value_lines_or_line`
@balupton balupton marked this pull request as draft February 8, 2025 18:22
…me as `curl`

caused by `-quiet` instead of `--quiet`, however `--no-verbose/-nv` is actually desired, as it makes errors outputted which is what we do for our `curl` implementation

/regression since 8292276
- 8292276#diff-fc2bc2f535254e954ecf9c2585d7ea395d07d1a59e2177638631d7981d2db9d8L101-R141

as this is a 2 year old bug, this was never encountered in practice because `curl` is the preferred implementation and `curl` is dep of dorothy so it is always used in practice
blame goes back to 686a1ba

this is a non-functional bug, as the checks will just ignore it as it doesn't exist

the bug is that `("${@:1}")` includes the title, whereas we just want the paths
…eady knows they are setup, enables quicker debugging
… terms of overriding the actions default behaviour and being the preference
thanks to our shim in `bash.bash` it is always available

also fixes a double load of `bash.bash` in `get-array`
cspell:
- update spellcheck for new utilities

command-working:
- add `ssh` to exceptions, this was needed as `setup-util-ssh` now checks for `ssh` as it handles the client too, which does a `ssh` check

cpr, fs-diff:
- update and correct comments on tooling and installers

dorothy:
- completely rewrote the user configuration setup process to reduce friction, streamline UX for beginners and pros, and eliminate fragility
- questions now have descriptions for YOLO no-RTFM users who install first and expect the installation to walk them through the project, shoutout to our YOLO user `@christianaudigeur6177` on youtube
- incentives authentication with github and gitlab to offer a superior repo creation/verification experience, and to prevent rate limiting /close #225 /improves #270
- able to now detect renamed github repositories if using the github cli, and prompts the user for what to do /ref #225
- robust and intuitive fallbacks if any step fails
- clear and robust strongbox setup, with improved description and flow, no longer waits for confirm as we now auto-verify
- strongbox and dorothy repo detection is now offloaded to `git-helper` rather than fetch, this means it now works on all repositories not just public github repositories, with none of the fragility, /close #266
- remove a legacy `__require_array 'mapfile'` /ref c158b97

get-installer:
- update aliases for the updated `setup-util-*` comments

git-helper:
- add `get-remote-file`, `has-remote-file`, `is-dorothy`, `is-strongbox` actions
- correct `--` usage in help text
- remote selection skips confirmation if there is only one remote

add:
- `setup-util-croc` intended for `cpr` and dorothy strongbox init
- `setup-util-diff` extracted from `setup-util-git`
- `setup-util-diff-so-fancy` intended for `fs-diff`
- `setup-util-difftastic` intended for `fs-diff`
- `setup-util-git-lfs` extracted from `setup-util-git`
- `setup-util-gitell` extracted from `setup-util-git`
- `setup-util-magic-wormwhole` intended for `cpr` and dorothy strongbox init
- `setup-util-meld` extracted from `setup-util-git`
- `setup-util-pinentry` extracted from `setup-util-git`
- `setup-util-ssh` handles the client and server, previously `setup-util-sshd` only handled server, that is not deprecated
- `setup-util-ssh-askpass` extracted from `setup-util-git`
- `setup-util-termscp` intended for `cpr` and dorothy strongbox init

setup-util:
- check is no longer constrained to `--quiet` mode, as we can just output the necessary text, this dramtically improves the successful checks which prevents DOWNLOAD determinations hitting the GitHub API causing Rate Limit encounters during the intial non-quiet dorothy setup experience /improves #270

setup-util-*:
- changed `setup-util "$@" --check --cli=<cli>` to `setup-util --check --cli=<cli> "$@"`, such that `--no-check` can be passed by the user to disable the checks

setup-util-gh:
- clearer messaging on why one would want to authenticate

setup-util-git:
- extract extra installers into their own `setup-util-*` scripts

setup-util-node:
- correct a syntax for a `git-helper` call

docs/private-configuration:
- update for new strongbox flow

deprecated:
- `setup-util-sshd` has been replaced by `setup-util-ssh` which now handles both client and server
@balupton balupton force-pushed the dev/devilbird branch 4 times, most recently from 07d5d80 to cb51e8f Compare February 9, 2025 18:41
it cannot delete unset variables, so check them first:
- https://github.com/bevry/dorothy/actions/runs/13228345318/job/36922092005#step:9:82

to debug in the future:

```
      - name: 'Debug Login Shell: xonsh'
        shell: bash -leo pipefail {0}
        run: |
          echo-file -- '/home/runner/.config/xonsh/rc.xsh'
          echo-file -- xonsh.log || :
          setup-environment-commands xonsh --refresh
```
@balupton balupton force-pushed the dev/devilbird branch 2 times, most recently from b76430c to f1ab3b7 Compare February 10, 2025 07:41
dorothy, eval-tester, debug-bash:
- testing on all or specific bash versions now moved to `debug-bash`
- by default `dorothy test` will now test on all available bash versions
- `dorothy test` and `debug-bash` can specify multiple custom bash versions/binaries via `--bash=<version/binary>`
- `eval-tester` can specify a specific custom bash version/binary via `--bash=<version/binary>`
- `debug-bash` now doens't include `-x` by default, you have to include it
- now enforces the specific bash binary via a `PATH` bin symlink handle, which ensures the bash version is enforced correctly in all command invocations, not just the immediate ones, except of course when they source `environment.bash` but that is a case we don't wnat to handle
- `dorothy test` now can also customise the skips via `--skip=<test>`
- `eval-tester` now sources `debug-bash` such that it can now correctly debug functions

eval-helper:
- now code styles the default wrapped command output, to make things easier to follow

dorothy:
- as the `eval_capture` race condition is now fixed, make flakey clean such that we can retest them, as perhaps their issues were due to the race condition
- test if `__debug_lines` lingered
- test if `eval_capture` failed to cleanup

`bash.bash:eval_capture`:
- added new `__debug_lines` helper in `bash.bash`, which `dorothy test` will check if any lingered and will fail
- now has more detailed debugging (commented out) as well as expanatory comments
- fixed some comment documentation for pipefail and errtace options
- now correctly licensed under the RPL as is the rest of dorothy
- now correctly saves the status output to handle a special use case, which currently is still debugged - before the code for this was present, but a typo that commented out the `__print_lines` code prevented it from ever being loaded, so as there was no issues over the 2 years this was the case, it may not actually be needed, hence the lingering `__debug_lines` statement for us to detect this on CI, as it may just affect specific bash versions, so more testing is needed (that will come later)
- the move to `[[` actually allows us to move `__is_errexit` and `__is_subshell_function` to their own methods, without impacting the `eval_capture` trap
- fixed the race condition (works on everything except bash 4.1.0) /close #277
- the race condition fix also allows us to not bother with the temp file checks, as we can assume that have been written by then

versions.md:
- all this improved testing has revealed that bash versions below 3.2 are unsupported
- remove unnecessary mapfile require
- use root convention for fs-temp
rewrote `get-installer` so that instead of using a bash v4 associative array, it now uses a json file, similar to what became possible in `setup-dns` several months ago

this also allows the possibility of automatic sorting of the keys

I've also moved the `--test` into its own subshell function as per standard convention, and did this by introducing a `--verify` option that works with `--quiet` to `get-installer`

I have also updated the verification to do a single call to `echo-style` which dramatically improves performance

/fixes https://github.com/bevry/dorothy/actions/runs/13235857374/job/36940496915#step:2:10920

/implements half of the suggestion in #282

other changes:

`dorothy test`:
- remove handling of flakey tests, solve their flakeyness instead
- prior flakeyness was due to the eval_capture race condition which is now solved

`setup.bash`:
- don't default to installing neovim
also:
- update `secret` to put output in the correct locations
- remove `foreach_line.md` as there is now `echo-eval`
/improves #283
/fixes https://github.com/bevry/dorothy/actions/runs/13254558267/job/36998982191#step:2:502

update tests in `dorothy-config`, `echo-lines-after`, `echo-lines-before` to correctly detect and report a regression here
this seems a bug since the code's inception perhaps, turns out it the code was way more complicated than it needed to be

/ref https://github.com/bevry/dorothy/actions/runs/13278077334/job/37071206385#step:2:1174
dorothy:
- move shell configuration entirely to `setup-shell`, which is the correct place for it
    - this is the correct location for it, and allows shell installations and uninstallations to correct configure, deconfigure, select, and deselect themselves
- extract `fs-relocate` into its own command

echo-file, echo-wait:
- WIP

fetch:
- noramlise `wget` and `curl` variants of SIGPIPE failures into SIGPIPE failures, so the caller can act accordingly

setup-dns:
- fix help text

setup-environment-commands:
- consolidate prefix directory handling with new `add_prefix_dir` helper, which now handles all the complexities of such in a simpler and more robust way
- add `XDG_PREFIX` var
- the combination of changes here now enables building on macos without `setup-util-devel` needed

setup-git:
- add `--[no-]fallback`, `--no-extras`, and `--slim` support to support (de|re)configuration if uninstalling homebrew

setup-mac-brew:
- fix `setup-util-brew --uninstall` flow, as it may uninstall our current shell, so we should expect a crash and not do more stuff after the uninstall

setup-shell:
- handle installation, uninstallation, configuration, deconfiguration, selection and unselection, rather than just install/configure
- this prevents issues when uninstalling dorothy, uninstalling homebrew, and uninstalling a specific shell
- this guides the user through the installation process, for those who are YOLO no-RTFM users, or beginners who did RTFM but didn't understand any of it

setup-util:
- add `--configure` action to be a no-op on `--check` utilities
- rename `--check=<cmd>` to `--checker=<cmd>` such that `--[no-]check` is a boolean that makes it easier to handle, and prevents conflicts when toggling
- redid and simplied relevance algorithm
- improved verbosity when building download deps, such that debugging is easier

setup-util-bash:
- `setup-environment-commands` has been updated to support building on macos without `setup-util-devel`
- install to / uninstall from `XDG_PREFIX` when building
- simpler prompt for changing login shell if outdated bash
- update the build flags to include what bash reocmmends

setup-util-brew:
- fix uninstallation, fix `setup-dns` deconfiguration, fix `setup-git` deconfiguration

setup-util-(gawk|gsed):
- fix building, based on learnings from setup-util-bash

setup-util-nu:
- configure on other invokations than just install, but correctly document configuration can only occur if nu exists

setup-util-zsh:
- use the new `fs-relocate` command to ensure zsh configuration is in the correct location

bash.bash:
- add new helpers `__ignore_exit_status` and `__ignore_sigpipe`

stdinargs.bash:
- fix oudated comments explaining sigpipe and timeout handling

todo:
- [ ] echo-file, echo-wait reworking
- [ ] config-helper auto-escalation
- [ ] setup-util-$shell: call `setup-shell` when uninstalling, or on installation if non-quiet
- [ ] setup-util-brew: uninstall: the login shell handling in this is added, but is nonsensical, fix it to run `setup-shell --no-brew`
- [ ] ensure `setup-util "$@" --check` is updated for the new syntax
@balupton balupton force-pushed the dev/devilbird branch 3 times, most recently from 9c452fc to 7f4e7fc Compare February 13, 2025 14:04
/continues f53c564

echo-unique:
- new command that supports arguments, and stdin content without sorting

choose:
- fix ctrl+c not returning to default screen buffer

dorothy, fs-relocate:
- fix bad refactor of last commit

echo-file:
- don't output separator between files, as we don't want that in all use cases

git-helper:
- add `--no-confirm-solo` to protocol prompt
- add repository details to all sensible prompts

setup-shell:
- fix the broken implementation of before
- add installed and configured shell detection and use it when merging with preferences
- add version detection
- don't crash on unconfigurable shells
- improved formatting
- fix crash on deconfigure

setup-util:
- lint

remaining todos:
- [ ] config-helper sudo escalation
- [ ] find out why xonsh is not getting installed
- [ ] find out why all the shells aren't be configured correctly
- [ ] save configuration updates

Co-authored-by: hjalmar jakobsson <[email protected]>
@balupton balupton force-pushed the dev/devilbird branch 2 times, most recently from a6cf1a7 to b56a2bc Compare February 16, 2025 07:47
had to split allow/disallow and login, as the flow was too confusing with them as one

now actions are: install/uninstall, configure/deconfigure, allow/disallow, login

implemented the arg handling

fixed duplication and detection and exclusions etc for basenames and paths

also innovated with ksh and dash config loading, they can now be toggled independently

need to apply configuration saving now, setup-util-$shell configuration/deconfiguration, etc

also fix linting issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant