@@ -1660,6 +1660,82 @@ it.effect("reads a host-native stack through the provider and null where it has
16601660 } ) ,
16611661) ;
16621662
1663+ it . effect ( "routes explicit Forgejo HTTP authorities through SSH checkouts after refinement" , ( ) =>
1664+ Effect . gen ( function * ( ) {
1665+ for ( const provider of [ "forgejo" , "unknown" ] as const ) {
1666+ const seen : string [ ] = [ ] ;
1667+ const service = yield * makeService ( {
1668+ projects : [
1669+ project ( {
1670+ id : "ssh" ,
1671+ title : "ssh" ,
1672+ workspaceRoot : "/ssh" ,
1673+ repository : "team/repo" ,
1674+ provider,
1675+ host : "code.example" ,
1676+ remoteUrl :
"[email protected] :team/repo.git" , 1677+ } ) ,
1678+ ] ,
1679+ providers : [
1680+ fakeProvider ( "forgejo" , {
1681+ getChangeRequestSummary : ( input ) =>
1682+ Effect . sync ( ( ) => {
1683+ seen . push ( input . host ) ;
1684+ return changeRequest ( 42 , "2026-07-02T00:00:00Z" ) ;
1685+ } ) ,
1686+ } ) ,
1687+ ] ,
1688+ resolveHandle : ( { context } ) =>
1689+ Effect . succeed ( {
1690+ context : { ...context ! , provider : { ...context ! . provider , kind : "forgejo" } } ,
1691+ provider : undefined as never ,
1692+ } ) ,
1693+ } ) ;
1694+ yield * service . summary (
1695+ {
1696+ projectId : "ssh" as ProjectId ,
1697+ host : "code.example:3000" ,
1698+ repository : "team/repo" ,
1699+ number : 42 ,
1700+ } ,
1701+ { recoverTransientFailure : false } ,
1702+ ) ;
1703+ assert . deepStrictEqual ( seen , [ "code.example:3000" ] ) ;
1704+ }
1705+ } ) ,
1706+ ) ;
1707+
1708+ it . effect ( "rejects a different Forgejo HTTP port for an HTTP checkout" , ( ) =>
1709+ Effect . gen ( function * ( ) {
1710+ const service = yield * makeService ( {
1711+ projects : [
1712+ project ( {
1713+ id : "http" ,
1714+ title : "http" ,
1715+ workspaceRoot : "/http" ,
1716+ repository : "team/repo" ,
1717+ provider : "forgejo" ,
1718+ host : "code.example" ,
1719+ remoteUrl : "http://code.example:4000/team/repo.git" ,
1720+ } ) ,
1721+ ] ,
1722+ providers : [ fakeProvider ( "forgejo" ) ] ,
1723+ } ) ;
1724+ const failure = yield * service
1725+ . summary (
1726+ {
1727+ projectId : "http" as ProjectId ,
1728+ host : "code.example:3000" ,
1729+ repository : "team/repo" ,
1730+ number : 42 ,
1731+ } ,
1732+ { recoverTransientFailure : false } ,
1733+ )
1734+ . pipe ( Effect . flip ) ;
1735+ assert . strictEqual ( failure . _tag , "PullRequestUnavailableError" ) ;
1736+ } ) ,
1737+ ) ;
1738+
16631739it . effect ( "routes a hosted reference to another repository through a project on that host" , ( ) =>
16641740 Effect . gen ( function * ( ) {
16651741 const seen : Array < { cwd : string ; repository : string ; host : string } > = [ ] ;
0 commit comments