Skip to content

Commit d678171

Browse files
Copilotf2calv
andcommitted
fix: comprehensive repository audit — CI, runtime bugs, code quality, devcontainer
- GitVersion.yml: add copilot branch pattern to prevent >63-char helm labels - deployment.yaml: add missing APP_ prefix to all env var names (runtime bug) - Cargo.toml: remove unused serde_json dependency - src/main.rs: fix misleading comment (INFO → DEBUG default log level) - Dockerfile: use absolute path in ENTRYPOINT - build.sh: fix shebang (sh → bash) to match bash-specific read -p usage - Chart.yaml: replace helm create placeholder appVersion 1.16.0 with 0.0.0 - .devcontainer: update to current mcr.microsoft.com/devcontainers/rust:1-bookworm - devcontainer.json: fix deprecated rust-analyzer.checkOnSave.command setting Co-authored-by: f2calv <16097639+f2calv@users.noreply.github.com> Agent-Logs-Url: https://github.com/f2calv/multi-arch-container-rust/sessions/2d38c791-ae0e-4533-98a2-0094712253fe
1 parent 8be5707 commit d678171

10 files changed

Lines changed: 22 additions & 23 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust/.devcontainer/base.Dockerfile
1+
# See here for image contents: https://github.com/devcontainers/images/tree/main/src/rust
22

3-
# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye
4-
ARG VARIANT="buster"
5-
FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT}
3+
ARG VARIANT="bookworm"
4+
FROM mcr.microsoft.com/devcontainers/rust:1-${VARIANT}
65

76
# [Optional] Uncomment this section to install additional packages.
87
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

.devcontainer/devcontainer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust
2+
// https://github.com/devcontainers/images/tree/main/src/rust
33
{
44
"name": "Rust",
55
"build": {
66
"dockerfile": "Dockerfile",
77
"args": {
8-
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
9-
// Use bullseye when on local on arm64/Apple Silicon.
10-
"VARIANT": "bullseye"
8+
// Use the VARIANT arg to pick a Debian OS version: bookworm, bullseye
9+
"VARIANT": "bookworm"
1110
}
1211
},
1312
"runArgs": [
@@ -40,7 +39,7 @@
4039
"files.watcherExclude": {
4140
"**/target/**": true
4241
},
43-
"rust-analyzer.checkOnSave.command": "clippy"
42+
"rust-analyzer.check.command": "clippy"
4443
},
4544
// Add the IDs of extensions you want installed when the container is created.
4645
"extensions": [

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ log = "0"
1313
ctrlc = "3"
1414
tokio = { version = "1", features = ["full"] }
1515
serde = { version = "1", features = ["derive"] }
16-
serde_json = "1"
1716
sys-info = "0"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ ENV APP_GITHUB_RUN_ID=$GITHUB_RUN_ID
9292
ARG GITHUB_RUN_NUMBER
9393
ENV APP_GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER
9494

95-
ENTRYPOINT ["./multi-arch-container-rust"]
95+
ENTRYPOINT ["/multi-arch-container-rust"]

GitVersion.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ branches:
66
feature:
77
regex: ^features?[/-]
88
tag: useBranchName
9+
copilot:
10+
regex: ^copilot[/-]
11+
tag: 'copilot'
912
ignore:
1013
sha: []
1114
merge-message-formats: {}

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
#set variables to emulate running in the workflow/pipeline
44
GIT_REPOSITORY=$(basename `git rev-parse --show-toplevel`)

charts/multi-arch-container-rust/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ version: 0.1.0
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "1.16.0"
24+
appVersion: "0.0.0"

charts/multi-arch-container-rust/templates/deployment.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ spec:
4646
protocol: TCP
4747
env:
4848
{{- if hasKey .Values "git" }}
49-
- name: "GIT_REPOSITORY"
49+
- name: "APP_GIT_REPOSITORY"
5050
value: {{ .Values.git.repository | default "" | quote }}
51-
- name: "GIT_BRANCH"
51+
- name: "APP_GIT_BRANCH"
5252
value: {{ .Values.git.branch | default "" | quote }}
53-
- name: "GIT_COMMIT"
53+
- name: "APP_GIT_COMMIT"
5454
value: {{ .Values.git.commit | default "" | quote }}
5555
{{- end }}
56-
- name: "GIT_TAG"
57-
value: {{ .Values.image.tag | default .Chart.AppVersion }}
56+
- name: "APP_GIT_TAG"
57+
value: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
5858
{{- if hasKey .Values "github" }}
59-
- name: "GITHUB_WORKFLOW"
59+
- name: "APP_GITHUB_WORKFLOW"
6060
value: {{ .Values.github.workflow | default "" | quote }}
61-
- name: "GITHUB_RUN_ID"
61+
- name: "APP_GITHUB_RUN_ID"
6262
value: {{ .Values.github.run_id | int64 | default 0 | quote }}
63-
- name: "GITHUB_RUN_NUMBER"
63+
- name: "APP_GITHUB_RUN_NUMBER"
6464
value: {{ .Values.github.run_number | int64 | default 0 | quote }}
6565
{{- end }}
6666
{{- if hasKey .Values "livenessProbe" }}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use sys_info::*;
77

88
#[tokio::main]
99
async fn main() -> std::io::Result<()> {
10-
// Set INFO logging level as default
10+
// Set DEBUG logging level as default
1111
env_logger::Builder::from_env(Env::default().default_filter_or("debug")).init();
1212

1313
//Load app settings from env variables

0 commit comments

Comments
 (0)