upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/prs_create.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-02-02 06:44:28 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-02-02 06:51:40 +0000
commitccdbc337ae16d7c70be44166269c8b2d5b9f5c09 (patch)
tree5cc6da88ef898e4376a25695b3b9c64ea30f84f7 /tests/prs_create.rs
parent401e60b98d94bc1f51dbd4b6083e92642a36efda (diff)
feat(prs-create)!: use nip34 patch kind and tags
- 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
Diffstat (limited to 'tests/prs_create.rs')
-rw-r--r--tests/prs_create.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/prs_create.rs b/tests/prs_create.rs
index f473683..ca92ac2 100644
--- a/tests/prs_create.rs
+++ b/tests/prs_create.rs
@@ -538,17 +538,11 @@ mod sends_pr_and_2_patches_to_3_relays {
538 538
539 #[test] 539 #[test]
540 #[serial] 540 #[serial]
541 fn parent_commit_and_parent_commit_r() -> Result<()> { 541 fn parent_commit() -> Result<()> {
542 // commit parent 'r' and 'parent-commit' tag 542 // commit parent 'r' and 'parent-commit' tag
543 static COMMIT_PARENT_ID: &str = "232efb37ebc67692c9e9ff58b83c0d3d63971a0a"; 543 static COMMIT_PARENT_ID: &str = "232efb37ebc67692c9e9ff58b83c0d3d63971a0a";
544 let most_recent_patch = prep()?; 544 let most_recent_patch = prep()?;
545 assert!( 545 assert!(
546 most_recent_patch
547 .tags
548 .iter()
549 .any(|t| t.as_vec()[0].eq("r") && t.as_vec()[1].eq(COMMIT_PARENT_ID))
550 );
551 assert!(
552 most_recent_patch.tags.iter().any( 546 most_recent_patch.tags.iter().any(
553 |t| t.as_vec()[0].eq("parent-commit") && t.as_vec()[1].eq(COMMIT_PARENT_ID) 547 |t| t.as_vec()[0].eq("parent-commit") && t.as_vec()[1].eq(COMMIT_PARENT_ID)
554 ) 548 )
@@ -558,9 +552,9 @@ mod sends_pr_and_2_patches_to_3_relays {
558 552
559 #[test] 553 #[test]
560 #[serial] 554 #[serial]
561 fn root_commit_as_r_with_r_hypen_prefix() -> Result<()> { 555 fn root_commit_as_r() -> Result<()> {
562 assert!(prep()?.tags.iter().any(|t| t.as_vec()[0].eq("r") 556 assert!(prep()?.tags.iter().any(|t| t.as_vec()[0].eq("r")
563 && t.as_vec()[1].eq("r-9ee507fc4357d7ee16a5d8901bedcd103f23c17d"))); 557 && t.as_vec()[1].eq("9ee507fc4357d7ee16a5d8901bedcd103f23c17d")));
564 Ok(()) 558 Ok(())
565 } 559 }
566 560
@@ -589,7 +583,7 @@ mod sends_pr_and_2_patches_to_3_relays {
589 .find(|t| t.as_vec()[0].eq("author")) 583 .find(|t| t.as_vec()[0].eq("author"))
590 .unwrap() 584 .unwrap()
591 .as_vec(), 585 .as_vec(),
592 vec!["author", "Joe Bloggs", "joe.bloggs@pm.me", "0,0"], 586 vec!["author", "Joe Bloggs", "joe.bloggs@pm.me", "0", "0"],
593 ); 587 );
594 Ok(()) 588 Ok(())
595 } 589 }
@@ -604,7 +598,7 @@ mod sends_pr_and_2_patches_to_3_relays {
604 .find(|t| t.as_vec()[0].eq("committer")) 598 .find(|t| t.as_vec()[0].eq("committer"))
605 .unwrap() 599 .unwrap()
606 .as_vec(), 600 .as_vec(),
607 vec!["committer", "Joe Bloggs", "joe.bloggs@pm.me", "0,0"], 601 vec!["committer", "Joe Bloggs", "joe.bloggs@pm.me", "0", "0"],
608 ); 602 );
609 Ok(()) 603 Ok(())
610 } 604 }