Skip to content

Commit 3228642

Browse files
Merge upstream develop
2 parents ec410fd + 74283e1 commit 3228642

3 files changed

Lines changed: 78 additions & 131 deletions

File tree

.gitlab/ci/deploy_app.yml

Lines changed: 36 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,89 +5,61 @@
55
- apps/polycentric/**/*
66
- .gitlab/ci/build_app.yml
77
- .gitlab/ci/deploy_app.yml
8-
needs:
9-
- job: app-web-image
10-
artifacts: false
11-
12-
variables:
13-
MANIFEST_GIT_REPO: https://gitlab.futo.org/devops/manifest-inventory.git
14-
MANIFEST_GIT_USER_EMAIL: $GITLAB_USER_EMAIL
15-
MANIFEST_GIT_USER_NAME: $GITLAB_USER_NAME
168

17-
#################################################################
18-
# Prepare the manifest changes as .patch files so we can review #
19-
#################################################################
9+
########################################
10+
# Tag the image with environment label #
11+
########################################
2012

21-
.app-deploy-prepare:
13+
.app-deploy-image:
2214
extends: .app-deploy-workflow
2315
stage: deploy
2416
image:
25-
name: alpine/git:latest
17+
name: gcr.io/go-containerregistry/crane:debug
2618
entrypoint: ['']
27-
before_script:
28-
- wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
29-
- chmod +x /usr/local/bin/yq
3019
script:
31-
# Pull in the manifest repository
32-
- git clone "https://gitlab-ci-token:${MANIFEST_GIT_TOKEN}@${MANIFEST_GIT_REPO#https://}" manifest-inventory
33-
- cd manifest-inventory
34-
# Use 'yq' to change the yaml value to the current commit
35-
- yq -i ".image.version.$ENVIRONMENT = strenv(CI_COMMIT_SHA)" inventory/polycentric-2026/app.yml
36-
# Commit the change in the manifest repo
37-
- git config user.email "$MANIFEST_GIT_USER_EMAIL"
38-
- git config user.name "$MANIFEST_GIT_USER_NAME"
39-
- git add inventory/polycentric-2026/app.yml
40-
- 'git commit -m "polycentric-2026 $ENVIRONMENT: bump app to $CI_COMMIT_SHA"'
41-
# Export the commit as a patch artifact
42-
- git format-patch -1 -o "$CI_PROJECT_DIR/deploy-patches/"
43-
# Print the patch in the job log for review
44-
- cat "$CI_PROJECT_DIR/deploy-patches/"*.patch
45-
artifacts:
46-
paths:
47-
- deploy-patches/
48-
expire_in: 1 week
20+
- crane auth login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
21+
- crane tag $CI_REGISTRY_IMAGE/app:$CI_COMMIT_SHA $ENVIRONMENT
22+
needs:
23+
- job: app-web-image
24+
artifacts: false
4925

50-
app-deploy-prepare-staging:
51-
extends: .app-deploy-prepare
26+
app-deploy-image-staging:
27+
extends: .app-deploy-image
5228
variables:
5329
ENVIRONMENT: staging
5430

55-
app-deploy-prepare-production:
56-
extends: .app-deploy-prepare
31+
app-deploy-image-production:
32+
extends: .app-deploy-image
33+
when: manual
5734
variables:
58-
ENVIRONMENT: polycentric
35+
ENVIRONMENT: production
5936

6037
###############################
61-
# Deploy the manifest changes #
38+
# Rolling restart on Manifest #
6239
###############################
6340

64-
.app-deploy-apply:
41+
.app-deploy-manifest:
6542
extends: .app-deploy-workflow
6643
stage: deploy
67-
image:
68-
name: alpine/git:latest
69-
entrypoint: ['']
70-
when: manual
71-
script:
72-
# Pull in the manifest repository
73-
- git clone "https://gitlab-ci-token:${MANIFEST_GIT_TOKEN}@${MANIFEST_GIT_REPO#https://}" manifest-inventory
74-
- cd manifest-inventory
75-
# Show the patch we are about to apply
76-
- cat "$CI_PROJECT_DIR/deploy-patches/"*.patch
77-
# Apply the patch and push it to the manifest repo
78-
- git config user.email "$MANIFEST_GIT_USER_EMAIL"
79-
- git config user.name "$MANIFEST_GIT_USER_NAME"
80-
- git am "$CI_PROJECT_DIR/deploy-patches/"*.patch
81-
- git push origin HEAD
44+
trigger:
45+
project: devops/manifest
46+
branch: master
47+
strategy: depend
48+
variables:
49+
MANIFEST_SETUP_COMMAND: quick
50+
MANIFEST_QUICK_TARGETS: inventory/polycentric-2026/app.yml:$ENVIRONMENT
51+
MANIFEST_STAGGER_TIME: '10'
8252

83-
app-deploy-apply-staging:
84-
extends: .app-deploy-apply
53+
app-deploy-manifest-staging:
54+
extends: .app-deploy-manifest
55+
variables:
56+
ENVIRONMENT: staging
8557
needs:
86-
- job: app-deploy-prepare-staging
87-
artifacts: true
58+
- app-deploy-image-staging
8859

89-
app-deploy-apply-production:
90-
extends: .app-deploy-apply
60+
app-deploy-manifest-production:
61+
extends: .app-deploy-manifest
62+
variables:
63+
ENVIRONMENT: production
9164
needs:
92-
- job: app-deploy-prepare-production
93-
artifacts: true
65+
- app-deploy-image-production

.gitlab/ci/deploy_server.yml

Lines changed: 36 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,89 +5,61 @@
55
- services/server/**/*
66
- .gitlab/ci/build_server.yml
77
- .gitlab/ci/deploy_server.yml
8-
needs:
9-
- job: server-image
10-
artifacts: false
11-
12-
variables:
13-
MANIFEST_GIT_REPO: https://gitlab.futo.org/devops/manifest-inventory.git
14-
MANIFEST_GIT_USER_EMAIL: $GITLAB_USER_EMAIL
15-
MANIFEST_GIT_USER_NAME: $GITLAB_USER_NAME
168

17-
#################################################################
18-
# Prepare the manifest changes as .patch files so we can review #
19-
#################################################################
9+
########################################
10+
# Tag the image with environment label #
11+
########################################
2012

21-
.server-deploy-prepare:
13+
.server-deploy-image:
2214
extends: .server-deploy-workflow
2315
stage: deploy
2416
image:
25-
name: alpine/git:latest
17+
name: gcr.io/go-containerregistry/crane:debug
2618
entrypoint: ['']
27-
before_script:
28-
- wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
29-
- chmod +x /usr/local/bin/yq
3019
script:
31-
# Pull in the manifest repository
32-
- git clone "https://gitlab-ci-token:${MANIFEST_GIT_TOKEN}@${MANIFEST_GIT_REPO#https://}" manifest-inventory
33-
- cd manifest-inventory
34-
# Use 'yq' to change the yaml value to the current commit
35-
- yq -i ".image.version.$ENVIRONMENT = strenv(CI_COMMIT_SHA)" inventory/polycentric-2026/server.yml
36-
# Commit the change in the manifest repo
37-
- git config user.email "$MANIFEST_GIT_USER_EMAIL"
38-
- git config user.name "$MANIFEST_GIT_USER_NAME"
39-
- git add inventory/polycentric-2026/server.yml
40-
- 'git commit -m "polycentric-2026 $ENVIRONMENT: bump server to $CI_COMMIT_SHA"'
41-
# Export the commit as a patch artifact
42-
- git format-patch -1 -o "$CI_PROJECT_DIR/deploy-patches/"
43-
# Print the patch in the job log for review
44-
- cat "$CI_PROJECT_DIR/deploy-patches/"*.patch
45-
artifacts:
46-
paths:
47-
- deploy-patches/
48-
expire_in: 1 week
20+
- crane auth login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
21+
- crane tag $CI_REGISTRY_IMAGE/server:$CI_COMMIT_SHA $ENVIRONMENT
22+
needs:
23+
- job: server-image
24+
artifacts: false
4925

50-
server-deploy-prepare-staging:
51-
extends: .server-deploy-prepare
26+
server-deploy-image-staging:
27+
extends: .server-deploy-image
5228
variables:
5329
ENVIRONMENT: staging
5430

55-
server-deploy-prepare-production:
56-
extends: .server-deploy-prepare
31+
server-deploy-image-production:
32+
extends: .server-deploy-image
33+
when: manual
5734
variables:
58-
ENVIRONMENT: polycentric
35+
ENVIRONMENT: production
5936

6037
###############################
61-
# Deploy the manifest changes #
38+
# Rolling restart on Manifest #
6239
###############################
6340

64-
.server-deploy-apply:
41+
.server-deploy-manifest:
6542
extends: .server-deploy-workflow
6643
stage: deploy
67-
image:
68-
name: alpine/git:latest
69-
entrypoint: ['']
70-
when: manual
71-
script:
72-
# Pull in the manifest repository
73-
- git clone "https://gitlab-ci-token:${MANIFEST_GIT_TOKEN}@${MANIFEST_GIT_REPO#https://}" manifest-inventory
74-
- cd manifest-inventory
75-
# Show the patch we are about to apply
76-
- cat "$CI_PROJECT_DIR/deploy-patches/"*.patch
77-
# Apply the patch and push it to the manifest repo
78-
- git config user.email "$MANIFEST_GIT_USER_EMAIL"
79-
- git config user.name "$MANIFEST_GIT_USER_NAME"
80-
- git am "$CI_PROJECT_DIR/deploy-patches/"*.patch
81-
- git push origin HEAD
44+
trigger:
45+
project: devops/manifest
46+
branch: master
47+
strategy: depend
48+
variables:
49+
MANIFEST_SETUP_COMMAND: quick
50+
MANIFEST_QUICK_TARGETS: inventory/polycentric-2026/server.yml:$ENVIRONMENT
51+
MANIFEST_STAGGER_TIME: '10'
8252

83-
server-deploy-apply-staging:
84-
extends: .server-deploy-apply
53+
server-deploy-manifest-staging:
54+
extends: .server-deploy-manifest
55+
variables:
56+
ENVIRONMENT: staging
8557
needs:
86-
- job: server-deploy-prepare-staging
87-
artifacts: true
58+
- server-deploy-image-staging
8859

89-
server-deploy-apply-production:
90-
extends: .server-deploy-apply
60+
server-deploy-manifest-production:
61+
extends: .server-deploy-manifest
62+
variables:
63+
ENVIRONMENT: production
9164
needs:
92-
- job: server-deploy-prepare-production
93-
artifacts: true
65+
- server-deploy-image-production

services/server/src/service/feeds/feeds_service.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ impl FeedsService for FeedsServiceImpl {
6060
let inner_req = request.into_inner();
6161
let limit = page_limit(&inner_req.page_params);
6262

63-
let caller = inner_req.follower_identity.ok_or_else(|| {
64-
Status::invalid_argument("follower_identity is required")
65-
})?;
63+
if inner_req.follower_identity.is_empty() {
64+
return Err(Status::invalid_argument(
65+
"follower_identity is required",
66+
));
67+
}
68+
let caller = inner_req.follower_identity;
6669

6770
let mut identities =
6871
FeedsRepository::Query::list_followed_identities(&self.db, &caller)

0 commit comments

Comments
 (0)