Skip to content

Conversation

nammn
Copy link
Collaborator

@nammn nammn commented Aug 26, 2025

Summary

This pull request focuses on improving shell script robustness and consistency across the codebase. The most significant change is an enhancement to the pre-commit hook's shellcheck integration, which now attempts to auto-fix issues and provides a clearer summary of failures.

Shellcheck automation and reporting:

  • Enhanced the .githooks/pre-commit script to attempt auto-fixing shellcheck issues, collect failed files, and display a summary of failures instead of exiting on the first error. This improves developer experience and code quality.
  • We will not print each file we check, that is not useful information. Only print if we fixed one or were unable to fix it automatically

Proof of Work

  • running make precommit locally - failing:
update_jobs: user       0m0.053s
update_jobs: sys        0m0.042s
lint_code: Go Version: go version go1.24.0 darwin/arm64
lint_code: Running golangci-lint...
start_shellcheck: shellcheck failed on scripts/dev/recreate_python_venv.sh
start_shellcheck: 
start_shellcheck: In scripts/dev/recreate_python_venv.sh line 80:
start_shellcheck:                 sudo apt-get update -qq && sudo apt-get install -y python3-venv || true
start_shellcheck:                                         ^-- SC2015 (info): Note that A && B || C is not if-then-else. C may run when A is true.
start_shellcheck: 
start_shellcheck: For more information:
start_shellcheck:   https://www.shellcheck.net/wiki/SC2015 -- Note that A && B || C is not if-t...
Some checks have failed:
    start_shellcheck (PID 53467)
To see the details look for the job's logs by it's prefixed name (e.g. "shellcheck failed"
  • passing:
ython_formatting: Skipped 8 files
python_formatting: formatting black
python_formatting: All done! ✨ 🍰 ✨
python_formatting: 410 files left unchanged.

real    0m11.694s
user    0m2.030s
sys     0m5.022s
pre-commit: All checks passed!
...

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@nammn nammn requested a review from a team as a code owner August 26, 2025 11:00
@nammn nammn marked this pull request as draft August 26, 2025 11:01
Copy link

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.3.0 Release Notes

New Features

Multi-Architecture Support

We've added comprehensive multi-architecture support for the kubernetes operator. This enhancement enables deployment on IBM Power (ppc64le) and IBM Z (s390x) architectures alongside
existing x86_64 support. Core images (operator, agent, init containers, database, readiness probe) now support multiple architectures. We do not add support IBM and ARM support for Ops-Manager and the init-ops-manager image.

Bug Fixes

  • This change fixes the current complex and difficult-to-maintain architecture for stateful set containers, which relies on an "agent matrix" to map operator and agent versions which led to a sheer amount of images.
  • We solve this by shifting to a 3-container setup. This new design eliminates the need for the operator-version/agent-version matrix by adding one additional container containing all required binaries. This architecture maps to what we already do with the mongodb-database container.
  • Fixed an issue where the readiness probe reported the node as ready even when its authentication mechanism was not in sync with the other nodes, potentially causing premature restarts.

Other Changes

  • Optional permissions for PersistentVolumeClaim moved to a separate role. When managing the operator with Helm it is possible to disable permissions for PersistentVolumeClaim resources by setting operator.enablePVCResize value to false (true by default). When enabled, previously these permissions were part of the primary operator role. With this change, permissions have a separate role.
  • subresourceEnabled Helm value was removed. This setting used to be true by default and made it possible to exclude subresource permissions from the operator role by specifying false as the value. We are removing this configuration option, making the operator roles always have subresource permissions. This setting was introduced as a temporary solution for this OpenShift issue. The issue has since been resolved and the setting is no longer needed.
  • We have deliberately not published the container images for OpsManager versions 7.0.16, 8.0.8, 8.0.9 and 8.0.10 due to a bug in the OpsManager which prevents MCK customers to upgrade their OpsManager deployments to those versions.

@nammn nammn added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Aug 26, 2025
@nammn nammn marked this pull request as ready for review August 26, 2025 11:20
@nammn nammn requested review from m1kola and lsierant August 26, 2025 11:26
@@ -202,7 +202,7 @@ wait_for_all_background_jobs() {
for failure in "${failures[@]}"; do
echo -e "$failure"
done
echo -e "${RED}To see the details look for the job's logs by it's prefixed name (e.g. \"shellcheck:\").${NO_COLOR}"
echo -e "${RED}To see the details look for the job's logs by it's prefixed name (e.g. \"shellcheck failed\").${NO_COLOR}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for better searching in the massive amount of logs

@@ -229,10 +229,17 @@ pre_commit() {
# Function to run shellcheck on a single file
run_shellcheck() {
local file="$1"
echo "Running shellcheck on $file"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no useful information printing that we are checking that file. Let's only echo on failure or when we fixed something

Copy link
Contributor

@lsierant lsierant left a comment

Choose a reason for hiding this comment

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

Awesome! LGTM!

Co-authored-by: Łukasz Sierant <[email protected]>
@viveksinghggits
Copy link
Contributor

Hi @nammn,
It looks like after you accepted the changes suggested by @lsierant, the precommit is broken on this PR again. Should try to merge this PR sooner, considering make precommit is broken on master.

@lucian-tosa lucian-tosa merged commit d40621c into master Aug 26, 2025
9 of 10 checks passed
@lucian-tosa lucian-tosa deleted the fix-shellchecks branch August 26, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Use this label in Pull Request to not require new changelog entry file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants