Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gitlab Project Doctor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
Numérique et Écologie
Gitlab Project Doctor
Commits
138cea37
Commit
138cea37
authored
1 year ago
by
Geoffrey Arthaud
Browse files
Options
Downloads
Plain Diff
Merge branch 'xx-bug-job-token' into 'main'
Fix program crashes when use job token See merge request
!3
parents
cb9dff06
2ae7760d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!3
Fix program crashes when use job token
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+8
-0
8 additions, 0 deletions
.gitlab-ci.yml
i18n/fr-FR/gitlab_project_doctor.ftl
+1
-1
1 addition, 1 deletion
i18n/fr-FR/gitlab_project_doctor.ftl
src/diagnosis/conf_analysis.rs
+13
-11
13 additions, 11 deletions
src/diagnosis/conf_analysis.rs
with
22 additions
and
12 deletions
.gitlab-ci.yml
+
8
−
0
View file @
138cea37
...
@@ -45,6 +45,9 @@ include:
...
@@ -45,6 +45,9 @@ include:
forceBuild
:
true
forceBuild
:
true
Dockerfile
:
${CI_PROJECT_DIR}/Dockerfile
Dockerfile
:
${CI_PROJECT_DIR}/Dockerfile
copy-image-rust
:
cache
:
[
]
release-gpd-image
:
release-gpd-image
:
needs
:
needs
:
-
release-linux
-
release-linux
...
@@ -68,6 +71,7 @@ test-rust-current:
...
@@ -68,6 +71,7 @@ test-rust-current:
script
:
script
:
-
cargo test --verbose
-
cargo test --verbose
-
cargo run -- $TEST_OPTIONS
-
cargo run -- $TEST_OPTIONS
-
cargo run -- $TEST_OPTIONS --token $TEST_GL_TOKEN
allow_failure
:
true
allow_failure
:
true
test-rust-nightly
:
test-rust-nightly
:
...
@@ -124,6 +128,8 @@ release-macos-silicon:
...
@@ -124,6 +128,8 @@ release-macos-silicon:
LDD_CMD
:
otool -L
LDD_CMD
:
otool -L
tags
:
tags
:
-
macos_mx
-
macos_mx
rules
:
-
if
:
$CI_COMMIT_TAG
release-macos-x86
:
release-macos-x86
:
extends
:
.rust-release
extends
:
.rust-release
...
@@ -133,6 +139,8 @@ release-macos-x86:
...
@@ -133,6 +139,8 @@ release-macos-x86:
LDD_CMD
:
otool -L
LDD_CMD
:
otool -L
tags
:
tags
:
-
macos_mx
-
macos_mx
rules
:
-
if
:
$CI_COMMIT_TAG
release-windows
:
release-windows
:
extends
:
.rust-release
extends
:
.rust-release
...
...
This diff is collapsed.
Click to expand it.
i18n/fr-FR/gitlab_project_doctor.ftl
+
1
−
1
View file @
138cea37
...
@@ -9,7 +9,7 @@ container-policy-disabled = L'option "Clean up image tags" est désactivée.
...
@@ -9,7 +9,7 @@ container-policy-disabled = L'option "Clean up image tags" est désactivée.
container-policy-enabled
=
L'option "Clean up image tags" est activée
container-policy-enabled
=
L'option "Clean up image tags" est activée
container-report
=
{
$image_count
}
images dans le container registry.
{
$old_image_count
}
datent de plus de
{
$nb_days
}
jours
container-report
=
{
$image_count
}
images dans le container registry.
{
$old_image_count
}
datent de plus de
{
$nb_days
}
jours
container-summary
=
Taille du container registry :
{
$registry_size
}
container-summary
=
Taille du container registry :
{
$registry_size
}
duplicate-assets-option-error
=
Cannot get t
he number of duplicate assets to keep
option
duplicate-assets-option-error
=
Impossible d'accéder à l'option "T
he number of duplicate assets to keep
"
duplicate-assets-option-onepackage
=
L'option "The number of duplicate assets to keep" vaut 1
duplicate-assets-option-onepackage
=
L'option "The number of duplicate assets to keep" vaut 1
duplicate-assets-option-warn
=
L'option "The number of duplicate assets to keep" ne vaut PAS 1
duplicate-assets-option-warn
=
L'option "The number of duplicate assets to keep" ne vaut PAS 1
error
=
Erreur :
error
=
Erreur :
...
...
This diff is collapsed.
Click to expand it.
src/diagnosis/conf_analysis.rs
+
13
−
11
View file @
138cea37
use
crate
::
diagnosis
::
gitlab_connection
::
Project
;
use
crate
::{
fl
,
GitlabRepository
,
ReportJob
,
ReportPending
,
ReportStatus
,
Reportable
};
use
gitlab
::
Gitlab
;
use
gitlab
::
Gitlab
;
use
graphql_client
::
*
;
use
graphql_client
::
*
;
use
crate
::
diagnosis
::
gitlab_connection
::{
GitlabToken
,
Project
};
use
crate
::{
fl
,
GitlabRepository
,
ReportJob
,
ReportPending
,
ReportStatus
,
Reportable
};
pub
struct
ConfAnalysisJob
{
pub
struct
ConfAnalysisJob
{
pub
gitlab
:
Gitlab
,
pub
gitlab
:
Gitlab
,
pub
project
:
Project
,
pub
project
:
Project
,
pub
job_token
:
bool
,
}
}
pub
struct
ConfAnalysisReport
{
pub
struct
ConfAnalysisReport
{
...
@@ -66,6 +68,7 @@ impl ConfAnalysisJob {
...
@@ -66,6 +68,7 @@ impl ConfAnalysisJob {
ConfAnalysisJob
{
ConfAnalysisJob
{
gitlab
:
gitlab
.gitlab
.clone
(),
gitlab
:
gitlab
.gitlab
.clone
(),
project
:
gitlab
.project
.clone
(),
project
:
gitlab
.project
.clone
(),
job_token
:
matches!
(
&
gitlab
.token
,
GitlabToken
::
JobToken
(
_
)),
}
}
}
}
...
@@ -85,6 +88,9 @@ impl ConfAnalysisJob {
...
@@ -85,6 +88,9 @@ impl ConfAnalysisJob {
}
}
fn
_report_duplicate_policy
(
&
self
)
->
ReportStatus
{
fn
_report_duplicate_policy
(
&
self
)
->
ReportStatus
{
if
self
.job_token
{
return
ReportStatus
::
ERROR
(
fl!
(
"duplicate-assets-option-error"
));
}
if
let
Some
(
policy
)
=
self
._get_duplicate_policy
()
{
if
let
Some
(
policy
)
=
self
._get_duplicate_policy
()
{
return
if
let
conf_package_duplicate_query
::
PackagesCleanupKeepDuplicatedPackageFilesEnum
::
ONE_PACKAGE_FILE
=
policy
{
return
if
let
conf_package_duplicate_query
::
PackagesCleanupKeepDuplicatedPackageFilesEnum
::
ONE_PACKAGE_FILE
=
policy
{
ReportStatus
::
OK
(
fl!
(
"duplicate-assets-option-onepackage"
))
ReportStatus
::
OK
(
fl!
(
"duplicate-assets-option-onepackage"
))
...
@@ -102,15 +108,11 @@ impl ConfAnalysisJob {
...
@@ -102,15 +108,11 @@ impl ConfAnalysisJob {
project_path
:
self
.project.path_with_namespace
.to_string
(),
project_path
:
self
.project.path_with_namespace
.to_string
(),
};
};
let
query
=
ConfPackageDuplicateQuery
::
build_query
(
variables
);
let
query
=
ConfPackageDuplicateQuery
::
build_query
(
variables
);
let
response
=
self
self
.gitlab
.gitlab
.graphql
::
<
ConfPackageDuplicateQuery
>
(
&
query
)
.graphql
::
<
ConfPackageDuplicateQuery
>
(
&
query
)
.unwrap
();
.ok
()
Some
(
.and_then
(|
r
|
r
.project
)
response
.and_then
(|
r
|
r
.packages_cleanup_policy
)
.project
?
.map
(|
r
|
r
.keep_n_duplicated_package_files
)
.packages_cleanup_policy
?
.keep_n_duplicated_package_files
,
)
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment