Skip to content

Rename KICSCommentRgxp identifiers to DDCommentRgxp and clean up kics comments#177

Merged
whitemerch merged 5 commits into
mainfrom
chakib.hamie/cleanup_kics_identifiers_and_comments
Jun 3, 2026
Merged

Rename KICSCommentRgxp identifiers to DDCommentRgxp and clean up kics comments#177
whitemerch merged 5 commits into
mainfrom
chakib.hamie/cleanup_kics_identifiers_and_comments

Conversation

@whitemerch
Copy link
Copy Markdown
Contributor

Motivation

Final cleanup of KICS/Checkmarx naming in internal Go identifiers and code comments. No behavior change.

Changes

model package

KICSCommentRgxp, KICSGetContentCommentRgxp, KICSCommentRgxpYaml renamed to DDCommentRgxp, DDGetContentCommentRgxp, DDCommentRgxpYaml respectively. All 6 call sites updated.

Comments

Remaining // kics ... and // KICS ... doc strings in comment.go, functions/default.go, provider/extract.go, and test/helpers.go reworded to remove the KICS reference.

QA Instruction

  1. go build ./...
  2. go test ./pkg/model/... ./pkg/parser/terraform/comment/... ./pkg/parser/docker/... ./pkg/parser/buildah/...

Impact

Internal rename only. No exported API, no CLI flags, no rule format affected.

@datadog-prod-us1-5
Copy link
Copy Markdown

datadog-prod-us1-5 Bot commented Jun 3, 2026

🎯 Code Coverage (details)
Patch Coverage: 71.88%
Overall Coverage: 47.97% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5404f42 | Docs | Datadog PR Page | Give us feedback!

@whitemerch whitemerch force-pushed the chakib.hamie/cleanup_kics_identifiers_and_comments branch from ee31ffa to 8e56626 Compare June 3, 2026 12:22
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e56626db2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/model/model.go
// KICSCommentRgxpYaml is the regexp to identify if the comment has KICS comment at the end of the comment in YAML
KICSCommentRgxpYaml = regexp.MustCompile(`((/{2})|#)*\s*dd-iac-scan\s*(ignore-line|ignore-block)\s*\n*$`)
// DDCommentRgxp identifies dd-iac-scan inline suppression comments
DDCommentRgxp = regexp.MustCompile(`(^|\n)((/{2})|#|;)*\s*dd-iac-scan\s*`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve existing exported comment regex names

In downstream Go code that imports github.com/DataDog/datadog-iac-scanner/pkg/model, this rename removes the previously exported model.KICSCommentRgxp, model.KICSGetContentCommentRgxp, and model.KICSCommentRgxpYaml identifiers, so consumers upgrading this module will fail to compile even though the change is described as having no exported API impact. Please keep deprecated aliases to the new DD* variables (or otherwise make the breaking change explicit) so existing integrations continue to build.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These regexes are only used across internal pkg/* packages; there are no known external Go importers of this module for these symbols. Adding KICS* aliases would undo the naming cleanup. We’re treating this as an intentional rename of previously exported-but-internal helpers; anyone embedding the module can switch to DDCommentRgxp / DDGetContentCommentRgxp / DDCommentRgxpYaml.

@whitemerch whitemerch marked this pull request as ready for review June 3, 2026 13:37
@whitemerch whitemerch requested a review from a team as a code owner June 3, 2026 13:37
@whitemerch whitemerch force-pushed the chakib.hamie/cleanup_kics_identifiers_and_comments branch from 8e56626 to 46e9e30 Compare June 3, 2026 14:08
ChouraquiBen
ChouraquiBen previously approved these changes Jun 3, 2026
Copy link
Copy Markdown
Contributor

@ChouraquiBen ChouraquiBen left a comment

Choose a reason for hiding this comment

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

No issues on the code but the name of the PR claims that the kics comment are removed. I some in other places, for example pre_scan.go so I am not sure what this entails

@whitemerch whitemerch force-pushed the chakib.hamie/cleanup_kics_identifiers_and_comments branch from 46e9e30 to 7472a04 Compare June 3, 2026 15:14
@whitemerch
Copy link
Copy Markdown
Contributor Author

No issues on the code but the name of the PR claims that the kics comment are removed. I some in other places, for example pre_scan.go so I am not sure what this entails

@ChouraquiBen because I missed some...

Copy link
Copy Markdown
Contributor

@ChouraquiBen ChouraquiBen left a comment

Choose a reason for hiding this comment

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

LGTM

@whitemerch whitemerch merged commit 76447a8 into main Jun 3, 2026
18 checks passed
@whitemerch whitemerch deleted the chakib.hamie/cleanup_kics_identifiers_and_comments branch June 3, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants