upleb.uk

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

summaryrefslogtreecommitdiff
path: root/test_utils/src
AgeCommit message (Collapse)Author
2026-02-25fix: suppress deprecation warnings for assert_cmd::cargo::cargo_binDanConwayDev
cargo_bin!() macro requires CARGO_BIN_EXE_ env vars set at compile time, which are only available in the crate that declares the binaries. Since test_utils is a library crate it cannot use the macro, so suppress the deprecation warning on the four functions that call cargo_bin().
2026-02-16test: fix all tests that use publishDanConwayDev
that expect whitespace then something
2026-02-16fix: report wording `fetching` ~> `checking`DanConwayDev
to be consistent with the summary version
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-14chore: bump rust-nostr v0.44DanConwayDev
fix breaking changes
2025-10-17chore: nix flake updateDanConwayDev
update nix dependancies including hardcoded nightly.rustfmt applied autofixes
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-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-07-31chore: bump rust-nostr v0.43DanConwayDev
with trival breaking changes. nip05 changes will be done seperately.
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-06-02tests: fix tests by adding maintainer ann eventDanConwayDev
to comply with changes in 5f45edbebe310decb06f955d95665a6ad387c6cb
2025-04-02test: fix test func get_proposal_branch_nameDanConwayDev
it was not correctly checking for "revision-root" tag rust-nostr v0.40 changed the sorting order so that the revision-root may be returned first causing intermitant test failures
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-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-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-12est(list): fix getting pr branch nameDanConwayDev
rust-nostr must have changes the order in which it returns elements. a proper fix would be to work out why there are duplicates!
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-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-10-28refactor: replace sqlite with lmdbDanConwayDev
as sqlite is depricated in rust-nostr
2024-09-25chore: bump rust-nostr v0.35DanConwayDev
bump all rust-nostr packages
2024-09-11refactor: fix fmt and clippy issuesDanConwayDev
which potentially were only identified when a dependancy was updated
2024-08-28chore: bump rust-nostr to v0.34.1DanConwayDev
this fixed an efficency thing which meant we needed to increase a timeout during the update which is reverted int his commit. see: nostr:nevent1qvzqqqqx25pzpgqgmmc409hm4xsdd74sf68a2uyf9pwel4g9mfdg8l5244t6x4jdqy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcqyqg5lfwhruw4qjpnlzq0tct0swnuj9dvavz8gsq8npuyygznstw36882alm
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-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-19test(remote): fix first test runDanConwayDev
if binaries in git-exec-path are copied to tmp-git-exec-path if the dir doesnt exist some enties fail to copy which was causing the first test to hang
2024-08-08test: increase rexpect timeout 3s ~> 4sDanConwayDev
to avoid tests intermitantly failing when there is no problem
2024-08-08feat(remote): `push` force push proposalDanConwayDev
will issue a proposal revision
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-08test(remote): helper to run as git remote helperDanConwayDev
add a test helper function to enable the git remote helper to be run as intended (via git) rather than calling it directly
2024-08-07test(git): make drop GitTestRepo optionalDanConwayDev
so that we can inspect the state of a test repo
2024-08-06feat(remote): `list` includes open proposalsDanConwayDev
and filters out other branches in `prs/*` namespace
2024-08-05test(remote): run `list for-push` before `push`DanConwayDev
because this is how git uses the git remote helper
2024-08-01feat(remote): `fetch` fallsback to other serversDanConwayDev
listed in the announcement `clone` tag
2024-08-01feat(remote): `push` to all `clone` serversDanConwayDev
initially we push to the first server, if successful update the state event, then siliently push to the others and silently fail
2024-08-01feat(remote): `fetch` uses state eventDanConwayDev
and falls back to git server is state event cant be found
2024-08-01test(remote): `recreate_as_bare` cp all branchDanConwayDev
previously `recreate_as_bare` was using clone and therefore just copying main branch
2024-07-31test(remote): add `recreate_as_bare` helperDanConwayDev
as gitlib2 cannot push to a non bare git repo in a directory
2024-07-31test(remote): `list` returns HEAD and mainDanConwayDev
returns head and main branch head
2024-07-31test(remote): test helpers and basic fetchDanConwayDev
create test helpers and setup basic test to verifiy fetch was ran
2024-07-25test: reintroduce `match_event` to test queriesDanConwayDev
removed in fc3f22eac2bb81823f170f61ba9d39baff76b933 as rust-nostr made it private attempts were made to reintroduce it in https://github.com/DanConwayDev/ngit-cli/pull/5 finally we can close #5, the last github PR
2024-07-24refactor: use nip34 kinds from rust-nostrDanConwayDev
instead of Kind::Custom(u16) as v33 of rust-nostr introduced them
2024-07-24test: abstract `list` and `pull` test codeDanConwayDev
to enable improved debugging
2024-07-24test: fix `pull` testsDanConwayDev
it was so much clearer what the problem was after abstracting reused test code
2024-07-24test: refactor `list` and `pull` to abstract codeDanConwayDev
into lib which makes reading and maintaining tests easier
2024-07-24test: fix intermitant failures due to timestampDanConwayDev
of proposals this is the same fix applied to `list` tests in bc1e9e7ff8d2c3747a7dbc3b649930ac5bc6425d but applied to `push` and `pull`
2024-07-24test: refactor `pull` and `push` to abstract codeDanConwayDev
into lib which makes reading and maintaining tests easier
2024-07-23feat(list): unique proposal branch namesDanConwayDev
to prevent accidental name conflicts. also moved to prs/* namespace `pull` and `push` integration tests are intermitantly failing to end at least for `push` they work when run individually but not when run together
2024-07-22test: increase rexpect timeout 2s ~> 3sDanConwayDev
to avoid tests intermitantly failing when there is no problem
2024-07-19feat: intergrate `fetch` into `send`DanConwayDev
reworking the tests and test suite as appropriate
2024-07-02feat(send): tag each maintainer's repo eventDanConwayDev
instead of just tagging the first maintainer's repo event and each maintainer with a p tag This allows for easier discoverability of the proposal when: * the first maintainer hasn't issued a repo event * the maintainers change over time and the single tagged repo event is no listed as a maintainer in anyone elses repo event
2024-07-01test: fix test affected by user configsommerfeld
applies: nostr:note14jnggugkcf9vg42tcu6h8c842xlxacsatw7uf889xjjdtqr0ptlsfa5tyh closes nostr:note1mm77j27kvmkwvvvvth7w4atgjhxrydafl5jkhh7eztkx4fxq4nqq6fnd6y
2024-06-28feat(login): login with nip46 remote signerDanConwayDev
and save details in git config
2024-06-26refactor: remove fresh test configDanConwayDev
as config is now stored using git config and cache is conditionally stored in local ./git folder under test conditions
2024-06-25refactor: replace keys with signerDanConwayDev
so that nip46 bunker signing can be added
2024-06-24feat(login): store in git config and use cacheDanConwayDev
replace ngit yaml file config with: * nsec / ncryptsec / npub in git config in nostr.* namespace * sql database cache for metadata and relay events allow different logins to be used for different git repositories by storing login in local git config
2024-06-21build: fix CLITesterConfirmPrompt succeeds withDanConwayDev
when the non-default option correctly sent
2024-06-13chore: bump rust-nostr to v0.32.0DanConwayDev
both nostr and nostr-sdk packages and also in test_utils fix the many breaking changes fix: ignore trailing slash when depuplicate relays for send events. this was picked up as TagStandard::RelayMetadata has started adding a traling slash. refactor cli output test function `expect_send_with_progress` so that relays can succeed / fail in a random order
2024-06-11refactor: bump rust-nostr to v0.30 use ncryptsecDanConwayDev
bump nostr and nostr-sdk packages and also in test_utils remove custom ncryptsec implementation and use the newly added implementation nip49 version in rust-nostr note a patched v0.30 is used so that log_n is exposed so that user can be warned it might take a few seconds to decrypt. this has now been merged into the library. note that this will no longer decrypt existing ncryptsec values as it is uses a longer string. this should therefore be bundled with the upcoming change to storing nsec and ncryptsec in git config.
2024-05-07feat(send): `in-reply-to` tags npubs and eventsDanConwayDev
in addition to being used to create a new proposal revision, in-reply-to can now be used to reference other events and npubs. for example an issues or kind 1 threads where the proposal is relevant the proposal will only be marked as a revision if the first parameter is a reference to an existing proposal root
2024-03-22rename from_sk_str -> from_strDanConwayDev
to reflect new name in rust-nostr
2024-03-22chore: nix flake updateDanConwayDev
update nix dependancies to latest version using default update options
2024-03-08feat(send): select commits from a listDanConwayDev
when since_or_range isn't specified adds resilience as assuming master..HEAD can cause some issues eg when master is not up-to-date with origin/master
2024-03-04refactor: improve rexpect error messageDanConwayDev
to enable better debugging
2024-03-04test: ensure failed tests timeoutDanConwayDev
resolve a long standing test issue where failures to output the correct message in the cli would result in the test never ending rather than failing the many test cases updated in this change are to ensure failures are caught rather than ignored some of them are just refactored to remove calling an extra function, which is no longer needed note: this doesn't fix the intermittent issue, most commonly experienced under the nix configuration, where tests that should pass occationally never end preventing the rest of the suite from running
2024-02-29build: added to gitignoreDanConwayDev
so temporarly created test directories and files are ignored
2024-02-21feat(send): specify commits eg HEAD~2DanConwayDev
specifiy commits or commit ranges in the same way that `git format-patch` allows
2024-02-20feat(list): set checkout branch as default choiceDanConwayDev
instead of no default. note: I spent hours trying to get CliTester to support default choices and gave up. I have a stashed the attempt and am moving on...
2024-02-13feat!: nip34 set pr kind to patch kindDanConwayDev
this enables consistancy of display with simple clients that are just taking the output of `git format-patch`
2024-02-13test: fix backtrace displayDanConwayDev
between 5 Feb 2024 and 13 Feb 2024 backtrace began activiating in `nix-shell` and ci during integration tests when rexpect. this caused some error tests to fail / hang it was not activating in the `nix-shell` when the cli was called seperately setting the `RUST_BACKTRACE=0` in the rexpect config surpresses the backtrace as desired
2024-02-13feat(prs-create)!: pr to nip34-like cover letterDanConwayDev
up the pr event type to a nip34-like cover letter format this sets the building blocks in place to enable simplier clients to use the 'cover letter' feature in `git format-patch` to create the experience as a pr event
2024-02-02feat(prs-create)!: use nip34 patch kind and tagsDanConwayDev
- change kind number - remove "r-" prefix from unique commit id r tag - rename tag commit-sig to commit-pgp-sig - a tag for repo identifer and pubkey. this serves as a vote for this pubkey being a maintainer - add relay hints - change format of committer tag - remove r references to parent commit id - tag parent patch event if its part of change request author and commit-message tags still need to be removed but they are required to apply patches with gitlib2. we will need to fallback to running the git client to apply patches. BREAKING CHANGE: change patch/commit event kind and tags to reflect nip34 draft. events with the older kind will no longer be found and will not be in a valid format
2024-02-02feat(repo_ref)!: align maintainers tag to nip34 styleDanConwayDev
nip34 specifies that repo event tags with multiple values wuch as "relays" and "web" use theformat: `["tag", "item", "item"...]` instead of: ``` ["tag", "item"], ["tag", "item"], ``` this update also adds clarity. it is not obvious that using a p tag is intended to make the pubkey a co-maintainer. BREAKING CHANGE: format of maintainers tags in repo events has changed to reflect nip34 style and ngit will not detect the old format
2024-02-02feat(repo_ref)!: use nip34 kind and tagsDanConwayDev
- change kind number - do not rely on d identifiers for unique commit id. set it as default to unique commit id shorthand. - remove "r-" prefix from unique commit id r tag and instead add checks for SHA1 validity - rename tag git_server to clone - add web tag - use single relays tag instead of multiple relay tags BREAKING CHANGE: change repo event kind and tags to reflect nip34 draft. events with the older kind will no longer be found and will not be in a valid format
2024-01-26chore: upgrade rust-nostr v0.27.0v0.1.1DanConwayDev
this is a contribution from jk (sectore) that I rebased and squashed into this commit. the tests were broken in the last few commits to rush out some fixes. this change may introduce more issues because of Relay.respond_standard_req.
2024-01-23build: env specific fallback relaysDanConwayDev
to prevent tests from poluting public relays
2024-01-22feat(claim): change repo event kindDanConwayDev
so that it is outside the 30000 <= n < 40000 parameterized replacable range
2024-01-22test: add maintainers to test repo eventDanConwayDev
this doesnt effect the current tests but is more realistic
2023-12-12feat(claim) create yaml add maintainers and relaysDanConwayDev
- create yaml file with maintainers and relays - add maintainers to repo event - add current user as maintainer - custom repo relays from cli argument - save git-server in repo event
2023-12-01feat(prs-list) list and pull selected as branchDanConwayDev
- fetch prs and present as a selectable list - create and / or checkout branch for selected pr - apply latest patches as commits
2023-11-01feat(prs-create) send to repo relaysDanConwayDev
fetch repository reference events to identify repository relays send pr events to repository relays alongside user relays
2023-11-01fixup! build(test) fix running tests togetherDanConwayDev
2023-11-01build(deps) update nostr nostr-sdkDanConwayDev
fix breaking changes
2023-11-01build(test) fix running tests togetherDanConwayDev
use a patched websocket server that releases port after x connections enabling its use in many tests included in the same test run
2023-11-01feat(login) fetch from discovered write relaysDanConwayDev
immediately request metadata and relay list from any newly discovered user write relays
2023-10-01feat(login) fetch user relays and metadataDanConwayDev
get user relay list and metadata events from relays when keys are used and last fetch attempt was more than an hour ago uses user's write relays if known, otherwise uses fallback relays to achieve this a method for intergration testing event fetching from relays was added
2023-10-01feat(prs-create) send to multiple relaysDanConwayDev
add tests but these currently don't work when run together
2023-10-01feat(prs-create) find commits and create eventsDanConwayDev
- identify commits - create pull request event - create patch events
2023-09-01feat(login) password login using encrypted nsecDanConwayDev
Enables the user to only handle the nsec upon first use of the tool by encrypting it with a password and storing it on disk in an application cache. The approach to encryption draws heavily from that used by the gossip nostr client. - unencrypted nsec is zeroed from memory - a salt is used to defend against rainbow tables - computationally expensive key stretching defends against brute-force attacks of passwords with low entropy. There is UX trade-off between decryption speed and key-stretching computation. This UX challenge is exacerbated in a cli tool as decryption must take place more regularly. Thought was put into the selected n_log and a heavily reduced value is provided for long passwords where security benefits are smaller. A more granular reducing in computation was also considered by rejected to avoided to revealing just how weak a password is as most weak passwords are reused.
2023-09-13refactor: rebuild app skeletonDanConwayDev
Create skeleton for a complete rebuild of the prototype as a production ready product. Includes design patterns for: - dependency injection - unit testing with dependency mocking - integration testing - error handling - config storage BREAKING-CHANGE: ground-up redesign with incompatible protocol standards