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
2ae7760d
Verified
Commit
2ae7760d
authored
1 year ago
by
Geoffrey Arthaud
Browse files
Options
Downloads
Patches
Plain Diff
Fix program crashes when use job token
parent
cb9dff06
No related branches found
No related tags found
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 @
2ae7760d
...
...
@@ -45,6 +45,9 @@ include:
forceBuild
:
true
Dockerfile
:
${CI_PROJECT_DIR}/Dockerfile
copy-image-rust
:
cache
:
[
]
release-gpd-image
:
needs
:
-
release-linux
...
...
@@ -68,6 +71,7 @@ test-rust-current:
script
:
-
cargo test --verbose
-
cargo run -- $TEST_OPTIONS
-
cargo run -- $TEST_OPTIONS --token $TEST_GL_TOKEN
allow_failure
:
true
test-rust-nightly
:
...
...
@@ -124,6 +128,8 @@ release-macos-silicon:
LDD_CMD
:
otool -L
tags
:
-
macos_mx
rules
:
-
if
:
$CI_COMMIT_TAG
release-macos-x86
:
extends
:
.rust-release
...
...
@@ -133,6 +139,8 @@ release-macos-x86:
LDD_CMD
:
otool -L
tags
:
-
macos_mx
rules
:
-
if
:
$CI_COMMIT_TAG
release-windows
:
extends
:
.rust-release
...
...
This diff is collapsed.
Click to expand it.
i18n/fr-FR/gitlab_project_doctor.ftl
+
1
−
1
View file @
2ae7760d
...
...
@@ -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-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
}
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-warn
=
L'option "The number of duplicate assets to keep" ne vaut PAS 1
error
=
Erreur :
...
...
This diff is collapsed.
Click to expand it.
src/diagnosis/conf_analysis.rs
+
13
−
11
View file @
2ae7760d
use
crate
::
diagnosis
::
gitlab_connection
::
Project
;
use
crate
::{
fl
,
GitlabRepository
,
ReportJob
,
ReportPending
,
ReportStatus
,
Reportable
};
use
gitlab
::
Gitlab
;
use
graphql_client
::
*
;
use
crate
::
diagnosis
::
gitlab_connection
::{
GitlabToken
,
Project
};
use
crate
::{
fl
,
GitlabRepository
,
ReportJob
,
ReportPending
,
ReportStatus
,
Reportable
};
pub
struct
ConfAnalysisJob
{
pub
gitlab
:
Gitlab
,
pub
project
:
Project
,
pub
job_token
:
bool
,
}
pub
struct
ConfAnalysisReport
{
...
...
@@ -66,6 +68,7 @@ impl ConfAnalysisJob {
ConfAnalysisJob
{
gitlab
:
gitlab
.gitlab
.clone
(),
project
:
gitlab
.project
.clone
(),
job_token
:
matches!
(
&
gitlab
.token
,
GitlabToken
::
JobToken
(
_
)),
}
}
...
...
@@ -85,6 +88,9 @@ impl ConfAnalysisJob {
}
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
()
{
return
if
let
conf_package_duplicate_query
::
PackagesCleanupKeepDuplicatedPackageFilesEnum
::
ONE_PACKAGE_FILE
=
policy
{
ReportStatus
::
OK
(
fl!
(
"duplicate-assets-option-onepackage"
))
...
...
@@ -102,15 +108,11 @@ impl ConfAnalysisJob {
project_path
:
self
.project.path_with_namespace
.to_string
(),
};
let
query
=
ConfPackageDuplicateQuery
::
build_query
(
variables
);
let
response
=
self
.gitlab
self
.gitlab
.graphql
::
<
ConfPackageDuplicateQuery
>
(
&
query
)
.unwrap
();
Some
(
response
.project
?
.packages_cleanup_policy
?
.keep_n_duplicated_package_files
,
)
.ok
()
.and_then
(|
r
|
r
.project
)
.and_then
(|
r
|
r
.packages_cleanup_policy
)
.map
(|
r
|
r
.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