Skip to content

GCI1024 [Team OSER][2025] - Amar salhi code add iac rules 1 - #398

Open
AmarSALHI-code wants to merge 4 commits into
green-code-initiative:mainfrom
AmarSALHI-code:AmarSALHI-code-add-iac-rules-1
Open

GCI1024 [Team OSER][2025] - Amar salhi code add iac rules 1#398
AmarSALHI-code wants to merge 4 commits into
green-code-initiative:mainfrom
AmarSALHI-code:AmarSALHI-code-add-iac-rules-1

Conversation

@AmarSALHI-code

Copy link
Copy Markdown

No description provided.

@pataluc

pataluc commented May 20, 2025

Copy link
Copy Markdown
Contributor

This rule is really interesting (and actually often implemented via Kyverno or admission controllers), but I'm not sure it is relevant regarding the green code initiative?

@AmarSALHI-code AmarSALHI-code changed the title Amar salhi code add iac rules 1 GCI1024 - Amar salhi code add iac rules 1 May 20, 2025
@AmarSALHI-code AmarSALHI-code changed the title GCI1024 - Amar salhi code add iac rules 1 GCI1024 - OSER- Amar salhi code add iac rules 1 May 20, 2025
@MP-Aubay MP-Aubay changed the title GCI1024 - OSER- Amar salhi code add iac rules 1 GCI1024 [Team OSER][2025] - Amar salhi code add iac rules 1 May 21, 2025
Comment thread src/main/rules/GCI1024/IaC/kubernetes/GCI1024.asciidoc Outdated

Participe à une orchestration plus efficace et économe.

== Compliant Code Example

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add a "non-compliant" example to have a comparison ?

Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
@@ -0,0 +1,16 @@
{
"title": "Avoid Spring repository call in loop or stream operations",
"type": "ECO_CODE",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type unknown : please check in sonarqube documentaion (custom plugin development) what values we can put here (maybe CODE_SMELL ?)

Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
"status": "todo",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "? min"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

evaluate how many time we spend to go from non compliant code to compliant code

Comment thread src/main/rules/GCI1024/IaC/GCI1024.json
@@ -0,0 +1,16 @@
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the path of this file is wrong ...
please check another example
JSON file will be inside root directory of "GCI1024"

Comment thread src/main/rules/GCI1024/IaC/kubernetes/GCI1024.asciidoc Outdated

@MP-Aubay MP-Aubay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for you PR, please Update also CHANGELOG.md.

I think for now, this rule is more a best practice more than a green code rule, probe will restart pod but if it continue to fail it will not killed it (as I fastly read in doc).

We need more proof to make this rule relevant.

Comment thread RULES.md Outdated
Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
Comment thread src/main/rules/GCI1024/IaC/GCI1024.json Outdated
Comment thread src/main/rules/GCI1024/IaC/kubernetes/GCI1024.asciidoc Outdated
Comment thread src/main/rules/GCI1024/IaC/kubernetes/GCI1024.asciidoc Outdated
Comment thread src/main/rules/GCI1024/IaC/kubernetes/GCI1024.asciidoc Outdated
@AmarSALHI-code
AmarSALHI-code force-pushed the AmarSALHI-code-add-iac-rules-1 branch from b282cf0 to 3de8021 Compare May 21, 2025 13:03
Comment thread RULES.md
- 🚫 Non applicable rule

| Rule key | Name | Description | Reference/Validation | Java | Php | JS | Python | Rust | C# | HTML |
| Rule key | Name | Description | Reference/Validation | Docker | Kuberenetes | Ansible| Terrafomr |CloudFormation |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo on Terraform (Terrafomr)

Comment thread CHANGELOG.md
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change the Unreleased, it will be update by CI

Comment thread RULES.md
- 🚫 Non applicable rule

| Rule key | Name | Description | Reference/Validation | Java | Php | JS | Python | Rust | C# | HTML |
| Rule key | Name | Description | Reference/Validation | Docker | Kuberenetes | Ansible| Terrafomr |CloudFormation |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the table after the existing one, to avoid modify the header


Additional information available on:

* Research articles:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theses articles do not seems to talk about probe (did not read it entirely)

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 60 days.
Please add a comment if you want to keep the issue open. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants