File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 4040 push : true
4141 cache-from : type=gha
4242 cache-to : type=gha,mode=max
43+ build-args : GIT_VERSION=${{ github.sha }}
4344
4445 - name : Kick ECS to deploy new version
4546 run : |
Original file line number Diff line number Diff line change 4242 push : true
4343 cache-from : type=gha
4444 cache-to : type=gha,mode=max
45+ build-args : GIT_VERSION=${{ github.sha }}
4546
4647 - name : Kick ECS to deploy new version
4748 run : |
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ COPY web web
2626# Precompress static web assets with gzip to avoid paying for their compression cost at runtime
2727RUN gzip --keep --best --force --recursive web/assets
2828
29+ ARG GIT_VERSION=unknown
30+ ENV GIT_VERSION=${GIT_VERSION}
31+
2932RUN cargo build --release
3033
3134FROM ubuntu:24.04 AS runtime
Original file line number Diff line number Diff line change 1+ use std:: fmt:: Write ;
12use std:: sync:: Arc ;
23
34use crate :: PgDbClient ;
@@ -10,8 +11,15 @@ pub(super) async fn command_ping(
1011 db : & PgDbClient ,
1112 pr_number : PullRequestNumber ,
1213) -> anyhow:: Result < ( ) > {
14+ let mut msg = "Pong :ping_pong:!" . to_string ( ) ;
15+
16+ // We don't embed the git version automatically, e.g. through the
17+ // `git-version` crate, because for production we build bors in Docker anyway, where there
18+ // is no git repo.
19+ let git_version = option_env ! ( "GIT_VERSION" ) . unwrap_or_else ( || "unknown" ) ;
20+ writeln ! ( msg, "\n \n bors build: `{git_version}`" ) . unwrap ( ) ;
1321 repo. client
14- . post_comment ( pr_number, Comment :: new ( "Pong 🏓!" . to_string ( ) ) , db)
22+ . post_comment ( pr_number, Comment :: new ( msg ) , db)
1523 . await ?;
1624 Ok ( ( ) )
1725}
@@ -24,7 +32,11 @@ mod tests {
2432 async fn ping_command ( pool : sqlx:: PgPool ) {
2533 run_test ( pool, async |ctx : & mut BorsTester | {
2634 ctx. post_comment ( "@bors ping" ) . await ?;
27- assert_eq ! ( ctx. get_next_comment_text( ( ) ) . await ?, "Pong 🏓!" ) ;
35+ insta:: assert_snapshot!( ctx. get_next_comment_text( ( ) ) . await ?, @"
36+ Pong :ping_pong:!
37+
38+ bors build: `unknown`
39+ " ) ;
2840 Ok ( ( ) )
2941 } )
3042 . await ;
You can’t perform that action at this time.
0 commit comments