upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2026-03-05fix(test_utils): suppress deprecated cargo_bin warningDanConwayDev
use_ngit_pr_checkout uses assert_cmd::cargo::cargo_bin which is deprecated in assert_cmd 2.1.0. Add #[allow(deprecated)] consistent with the existing suppression on rexpect_with and other callers.
2026-03-05fix(tests): update send tests to use --subject instead of --titleDanConwayDev
The send subcommand was updated to use --subject (with --title as an alias) but the non_interactive_validation tests still checked for --title in error messages and used --title as the CLI argument.
2026-03-05test(pr-checkout): replace broken ngit_list tests with ngit_pr_checkoutDanConwayDev
tests/ngit_list.rs had 27 tests all failing because the interactive mode they tested has been replaced by a non-interactive implementation. Replace the file with a stub documenting the coverage gaps and add tests/ngit_pr_checkout.rs covering the same proposal branch checkout logic via `ngit pr checkout <id>`, starting with the fresh-checkout case.
2026-02-26fix: correct merge-base in PR events from git push of pr/ branchDanConwayDev
When pushing a pr/ branch, the ahead slice is reversed by callers before being passed to generate_patches_or_pr_event_or_pr_updates, making it oldest-first. The tip/first_commit assignments were backwards (using first()/last() as if the slice were youngest-first), so the merge-base was computed as the parent of the PR tip rather than the parent of the oldest commit. Multi-commit PRs therefore showed only 1 commit when applied via ngit apply. Adds an integration test that pushes a two-commit large-file PR branch and asserts the merge-base tag equals the main branch tip.
2026-02-26fix: advertise only state events with resolvable git objectsDanConwayDev
git-remote-nostr now walks the per-relay state events captured in FetchReport::state_per_relay (newest first) and advertises the first one whose every OID is either present on at least one git server (confirmed via list_refs) or already available locally. If no such state event exists it falls back to the raw git server state. Previously the latest nostr state event was always used regardless of whether its OIDs had been pushed to any server, causing catastrophic missing-object errors during clone or fetch when a state event was published ahead of the corresponding git push.
2026-02-25fix: update hardcoded libgit2 version strings in tests to 1.9.2DanConwayDev
The Nix environment provides libgit2 1.9.2 via nixpkgs, which libgit2-sys picks up at build time instead of using its bundled version. This caused test assertions that hardcode the libgit2 version string (appended by libgit2 to patch output) to fail after commit 319bb7f added new Cargo dependencies, though the exact mechanism by which those dependencies triggered the switch from the bundled 1.9.1 to the system 1.9.2 remains unclear. Also bump git2 from 0.20.2 to 0.20.4 in both Cargo.toml files so the bundled libgit2-sys version (0.18.3+1.9.2) properly aligns with the 1.9.2 version in use.
2026-02-17fix: apply push-options to patch series generationDanConwayDev
The title and description push-options were previously only applied to PR creation but not to patch series generation. When force-pushing to update an existing patch series, the custom title and description were ignored. This change passes the title_description parameter to the patch generation function, allowing users to customize patch series cover letters via: git push --force --push-option=title="Title" \ --push-option=description="Description" origin branch Includes integration test for force-pushing patches with custom cover letter.
2026-02-17feat: support multiline descriptions in push-options via \n escapeDanConwayDev
Git push-options are line-based so literal newlines cannot be sent. Users can now write the two-character sequence \n which is decoded into real newlines before publishing. Use \\n for a literal backslash-n. Includes unit tests, integration test, help text, and changelog entry.
2026-02-17feat: add push-options for title and description to git-remote-nostrDanConwayDev
Allows setting PR title and description via git push options: git push --push-option=title="My PR" \ --push-option=description="Details" origin pr/branch
2026-02-16fix: report wording `fetching` ~> `checking`DanConwayDev
to be consistent with the summary version
2026-02-16fix: report wording `maintainers ~> announcementsDanConwayDev
'maintainers' is missleading as the announcement authors may not be in the maitnainer set
2026-02-11rename --relays flag to --relayDanConwayDev
Allow multiple values via repeated --relay flags instead of the less intuitive plural --relays form.
2026-02-11rename --grasp-servers flag to --grasp-serverDanConwayDev
Allow multiple values via repeated --grasp-server flags instead of the less intuitive plural --grasp-servers form.
2026-02-11feat: use fallback relays for bootstrapping onlyDanConwayDev
- Add --relay flag to 'ngit account create' allowing users to specify relay URLs (repeatable). Defaults to relay-default-set when not provided. - Remove fallback relays from fetch when repo context exists (repo coordinate provided). Only use them for bootstrapping (profile discovery with no repo context). - Remove fallback relays from publish when repo or user relays exist. Only use them when neither is available (e.g. new account signup). - Update --customize help text to reflect new relay-default-set behavior.
2026-02-10feat: update ngit send for non-interactive modeDanConwayDev
Rewrite ngit send to support non-interactive mode: - Add validation for required arguments (title/description) - Add --force flag to bypass commit suitability checks - Add --no-cover-letter flag to skip cover letter - Improve error messages for missing required fields - Update title/description/cover-letter logic for non-interactive mode - Add comprehensive tests for non-interactive behavior
2026-02-10feat: update ngit init for non-interactive modeDanConwayDev
Complete rewrite of ngit init to support non-interactive mode by default. Key changes: - Implement hybrid validation (validate all args upfront, fail fast) - Add --grasp-servers flag for specifying git servers - Prefer --name over --identifier for better UX - Add comprehensive validation with helpful error messages - Support both clone and init-from-existing-repo workflows - Add --force flag to bypass safety checks - Update tests for new non-interactive behavior - Add test utilities for non-interactive testing
2025-11-13feat(list): make list async and include sync report inlineDanConwayDev
copy relay fetching approach to async and reporting
2025-11-13fix: out of sync grasp server cli outputDanConwayDev
so it shows a summary rather than a lot of lines of issues
2025-11-13fix: cli output line deletion during fetchDanConwayDev
also reduce the clutter in the cli output for grasp servers.
2025-10-28test: refactor to use rstest more efficient test runsDanConwayDev
Identified high value areas to use rstest that would benefit most and refactored them
2025-10-17chore: nix flake updateDanConwayDev
update nix dependancies including hardcoded nightly.rustfmt applied autofixes
2025-09-03fix(remote): `refs/pr-by-id/*` ~> `refs/pr/*/head`DanConwayDev
to align more closely with githubs `refs/pull/*/head` we can pretend that pr means both Patch Request and Pull Request
2025-08-15feat(remote): list proposals as `refs/pr-by-id/*`DanConwayDev
This branch name cannot be attacked by brute forcing a shorthand event id like refs/pr/<branch-name(<shorthand-event-id) can.
2025-08-15feat(remote): list all proposals as `refs/pr/*`DanConwayDev
here we can list Pull Requests whose data aren't on the repo relays without causing `git clone nostr://` to fail. we can also list proposals of all statuses so that can review closed proposals.
2025-08-07Merge branch 'add-prs-to-ngit-send'DanConwayDev
2025-08-05feat(send): support PR and PR update eventsDanConwayDev
send as a PR if the commit would make patches that are too big for nostr events. send as a PR update if the proposal is PR. send as a PR, revising a patch root, if patches would be too big. in tests `get_pretend_proposal_root_event` has to be a actual proposal with a tip, rather than just a cover letter, so we have replaced it.
2025-08-04fix: `t` tag `revision-root` ~> `root-revision`DanConwayDev
NIP-34 specifies patch revisions should have a `t` tag of `root-revision` whereas we have been using `revision-root`. this fixes it and and handles events created with the incorrect tag.
2025-08-01fix: use new gitworkshop.dev url formatDanConwayDev
where just the nevent will do
2025-07-31fix: mention marker ~> q tag NIP-10 updateDanConwayDev
required for rust-nostr v0.43 update
2025-07-16chore: bump nightly rustfmtDanConwayDev
to latest available and apply fmt fixes
2025-07-16chore: nix flake updateDanConwayDev
required running: `cargo fix --allow-dirty --allow-staged` `cargo clippy --fix --allow-dirty -- -D warnings` to fix problems and then manually fixing some too
2025-07-16chore: cargo updateDanConwayDev
in prep for upgrade rust-nostr
2025-06-02tests: fix tests by adding maintainer ann eventDanConwayDev
to comply with changes in 5f45edbebe310decb06f955d95665a6ad387c6cb
2025-05-31feat(push): prevent push if no ann eventDanConwayDev
To ensure additional maintainers publish an annoucement event, require it for them to push
2025-05-23fix(init): improve cli outputDanConwayDev
for git push, a wait longer to allow ngit-relays to create repo
2025-05-22feat(init): overhaul & simplify with ngit-relaysDanConwayDev
introduce ngit-relays as a way of setting git servers and relays at the same time using a standard for specific repo locations: https://<domain-port-path>/<npub>/<identifer>.git add simple and advanced modes. prompt less. eg always set remote origin to nostr url. automatically push main or master branch.
2025-05-06chore: update git2 ~> v0.20.2DanConwayDev
we have had some bugs related to git2 so moving to the latest version
2025-05-05chore: nix flake updateDanConwayDev
update nix dependancies to latest version using default update options run `cargo clippy --fix` and `cargo fmt` to fix new clippy errors
2025-04-02test: patches shouldn't `p` tag authorDanConwayDev
rust-nostr upgrade to v0.40 removed this `p` tag
2025-04-01chore: bump rust-nostr v0.37 ~> v0.40DanConwayDev
and fix all of the breaking changes
2024-12-16chore: bump nix flake rust nightly `fmt` overlayDanConwayDev
update the rust nightly `fmt` overlay which needs to be pinned to a specific version (this case by date) update formatting in main files via `cargo fmt`
2024-12-13test(push): merge event for applied commitsDanConwayDev
publish a merge event when the commit author signature and timestamp match patches within an open proposal
2024-12-13test: deterministic commit timestamps in test PRsDanConwayDev
now that the remote helper uses the commit author timestamp to determine if commit was applied from a proposal, the timestamps in the test proposal can no longer be identical. this makes them deterministically different based on the file name
2024-12-12test(push): ff merge commit tag `merge-commit-id`DanConwayDev
allow any order of the commit ids
2024-12-12fix(push): three-way `merge-commit-id` `tag`DanConwayDev
should alway list only the three-way merge commit id.
2024-12-09fix: fetch user relays for `send`,`push` & `init`DanConwayDev
get the latest user relay list before pushing patches and repo announcement events
2024-12-06feat(push): send fast-forward merge status eventDanConwayDev
when a proposal was merged using fast-forward status rather than by creating a three way merge commit. if there are multiple revisions, the first one that contains merged proposal tip will be referenced. if there are multiple proposals that contain one of the commits, they will all be marked as merged. the nip needs to be updated as there is no single `merge-commit-id` so that tag needs to support multiple values
2024-12-05test(ngit): no nostr remote, search for repoDanConwayDev
update the tests to reflect the changes in the previous 4 commits
2024-11-29feat(init): set remote `origin`DanConwayDev
check whether remote `origin` is nostr url and if not attempt to set it.
2024-11-29test(init): fix cli white space issueDanConwayDev
otherwise the test never ends or fails
2024-11-29test(init): remove maintainers.yaml from testsDanConwayDev
as creation by default was removed in 9bee5f12efa5ed751468c68073c9122e12c22b5f
2024-11-27chore: bump rust-nosrt v0.37.0DanConwayDev
use RelayUrl in repo_ref which I had resisted as it mutates relay urls when printed to append a slash
2024-11-27test(login): fix `login` nested under `account`DanConwayDev
this was missed during a find and replace
2024-11-27feat: remove `pull` `push` and `fetch` ngit cmdsDanConwayDev
to simplify the api and encourage use of the git remote helper
2024-11-27feat(account): move login/out cmds to accountDanConwayDev
move login, logout export-keys commands to sub commands under account
2024-11-26test(login): update `ngit login` testDanConwayDev
to reflect the new interface and testing only nsec login
2024-11-26refactor: err msgs 'cannot' > 'failed to'DanConwayDev
in nearly all cases 'cannot' was used when an action was tried and failed. 'failed to' is strictly better because: * just because the action didn't work that time doesnt mean it cannot work * it is better at drawing the users attention to a problem
2024-11-25feat(list): report on action selectionDanConwayDev
there was a bug in `Interactor` so that reports were turned off by default for choices. This was embodied into the CLI tests but this turns them on in these scenarios.
2024-11-25test: fix login copyDanConwayDev
appended 'via cli arguments' to 'logged in as fred' during login step
2024-11-11chore: bump rust-nostr v0.36DanConwayDev
bump all rust-nostr packages to latest issued version. there have been some breaking changes to nip46 and this applies these changes.
2024-11-11Revert "refactor: remove ngit `pull` `push` `fetch`"DanConwayDev
This reverts commit 43b5e9b38bf5dcfbac85637a2d3efc69ddfe77ac.
2024-11-04refactor: remove ngit `pull` `push` `fetch`DanConwayDev
simplify api to encougage use of the git plugin
2024-10-28chore: bump rust-nostr to patch near v0.36.0DanConwayDev
bump all rust-nostr packages refactoring code based on breaking changes upgrading to patched version to address signer issue: nostr:nevent1qvzqqqqqqypzq6xcz9jerqgqkldy8lpg7lglcyj4g3nwzy2cs6u70wejdaj7csnjqy88wumn8ghj7mn0wvhxcmmv9uqzpsw5ph8le2n2kh6uchftawt74hddazk9tp7wjmz967y2l0uva5rc7hsstq
2024-09-25chore: bump rust-nostr v0.35DanConwayDev
bump all rust-nostr packages
2024-09-24test: restructure ngit integration testsDanConwayDev
so that each file is ran as a seperate crate this makes it easier to see which tests are causing other tests to fail as they are in a smaller group.
2024-09-24feat(login): login via nip46 QR codeDanConwayDev
or nostrconnect url string which is a much better UX flow for nip46
2024-09-23fix(remote): enable login through remote helperDanConwayDev
originally this was disabled because there was a concern that it would effect the operation of the remote helper due as it prints to stdout. it now only writes to stderr.
2024-09-23fix(remote): add resilience to `prs`DanConwayDev
make poorly formatted patches fail silently. we stop trusting that the `commit` tag in the latest patch can be produced by apply the patches. to achieve this we must recreate the commit during the list command, which require fetching the parent oids. support patches without optional `commit` and `parent-commit` tags.
2024-09-20feat(remote): add send events status reportingDanConwayDev
to both tell users where events have been sent / failed to be sent and to provide a status update so the user doesn't think its crashed
2024-09-19test: fix test name typo@RandyMcMillan
warngins ~> warnings
2024-09-18test: fix gitlib2 version in sampleDanConwayDev
so they match v1.8.2 used in updated git2
2024-09-18test(renote): fix whitespace in push` testsDanConwayDev
fixing what should have been picked up in: 7718a56ab05038e743401ea01628d85edc50ed34
2024-09-18test(renote): fix whitespace in push` testsDanConwayDev
reverting change in 73480c03e194808bec7cbbf8c2d7064743d03369
2024-09-18test: fix `generate_repo_with_state_event`DanConwayDev
which enables some failing `fetch` tests to pass
2024-09-17test(remote): fix test to ignore status updatesDanConwayDev
as changes to status updates has causes many tests to fail
2024-09-17test(remote): fix generate_repo_with_state_eventDanConwayDev
which enables fetch tests to pass
2024-09-12fix(remote): update copyDanConwayDev
to make it more like native git
2024-09-11refactor: fix fmt and clippy issuesDanConwayDev
which potentially were only identified when a dependancy was updated
2024-09-09test(remote): refactor split into multiple filesDanConwayDev
to make it easier to read and navigate
2024-09-09test: refactor into binary subdirsDanConwayDev
in prep for splitting git_remote_nostr tests
2024-09-06fix(remote): `fetch` and `list` status copyDanConwayDev
so that it the filesystem url is shown
2024-08-28chore: bump rust-nostr to v0.34.0DanConwayDev
bump all rust-nostr packages I'm not sure I'm completely happy with allowing mutable_key_type but it is just run inside tests it appears that Event didn't have the Copy trait in v0.33.0 so I'm not sure why this warning suddenly appeared the timeout of client.get_events_of needed to be doubled which could indicate that an ineffiency has been introduced in v0.34.0 the primary motivation for upgrading now was to get this fix: nostr:nevent1qqsffl2ld678pjj77rh9k2g4edljmxdu6ew4lvgnglxv7jhu3ru8vvcpp4mhxue69uhkummn9ekx7mqzyzsq3hh327t0h2dq6matqn5064cgj2zanl2stkj6s0lg4t2h5dty6rm2ucm as I suspect it is also effecting other repositories eg nostr-profile-manager
2024-08-27fix(init): make maintainer.yaml copy clearerDanConwayDev
as this has reduced in importance as the user begins by selecting a trusted maintainer
2024-08-20feat: set proposal branch prefix to `pr/`DanConwayDev
from `prs/`. whilst plural reflects usage of `heads` and `tags` in git refs, singular is shorter and more reflective of usage of branch prefixes such as `feature/` `fix/`
2024-08-18feat(remote): `push` log merge event creationDanConwayDev
so the user knows that a merge commit event will be issued
2024-08-18feat(remote): `push` publish merge eventDanConwayDev
when a merge commit is being pushed that merges a patch in a proposal
2024-08-09feat(remote): `push` new proposalDanConwayDev
issue new proposal when new branch is pushed into `prs/*` namespace, which doesn't match an existing proposal
2024-08-09feat(remote): remove pr id postfix for authorsDanConwayDev
remove the (<short id>) post fix for remote proposal branches when the current user is the author this enables pushing new proposals without having to change the upstream branch in a way that remote helpers weren't designed to do
2024-08-08fix(send): patch countDanConwayDev
fix [PATCH n/n] when no cover letter and patches great than 1 fixes error where the first patch would be [PATCH] followed by [PATCH n/n]
2024-08-08feat(remote): `push` force push proposalDanConwayDev
will issue a proposal revision
2024-08-08test(remote): improve robustness of testDanConwayDev
by allowing the output assert to fail rather than hang
2024-08-08test(remote): `push` to existing proposalDanConwayDev
push 2 commits to an existing proposal there are a lot of asserts in here but if they were split out into their own tests the suite would take much longer to run as we are waiting a few seconds in the test to ensure the timestamps are different
2024-08-07feat(remote): `fetch` applies proposal commitsDanConwayDev
that have been proposal tips returned by `list` can be found
2024-08-06fix(remote): `list` correct proposal refsDanConwayDev
as the `refs/heads/` prefix wasn't present
2024-08-06feat(remote): `fetch` report on progressDanConwayDev
so that user knows what step we are on
2024-08-06feat(remote): `list` includes open proposalsDanConwayDev
and filters out other branches in `prs/*` namespace
2024-08-06test(remote): `list` fix warning copyDanConwayDev
to align with changes in 557a5d98c6ea373db117d6fe19489086b4461aa7
2024-08-05feat(remote): `push` handle out-of-sync serversDanConwayDev
1. don't attempt to push to a remote which is already up-to-date 2. don't attempt to delete branch on remote if it is already deleted 3. only push when out of sync if remote tip is ancestor of pushed commit 4. force push to remote if user force pushed and remote is in sync with nostr
2024-08-05test(remote): remove `async_run_test`DanConwayDev
where it is not needed so code is easier to read
2024-08-05test(remote): run `list for-push` before `push`DanConwayDev
because this is how git uses the git remote helper