Skip to content

fix: prevent mkdef from creating partial objects on validation error#9

Merged
viniciusferrao merged 1 commit into
masterfrom
fix/mkdef-partial-object-on-validation-error
May 7, 2026
Merged

fix: prevent mkdef from creating partial objects on validation error#9
viniciusferrao merged 1 commit into
masterfrom
fix/mkdef-partial-object-on-validation-error

Conversation

@viniciusferrao

@viniciusferrao viniciusferrao commented Apr 27, 2026

Copy link
Copy Markdown
Member

Fixes xcat2#3706.

Summary

  • Treat only_if validation failures as real object errors instead of only printing an error.
  • Prevent errored objects from being marked updated or written through %allupdates.
  • Validate replacement objects before mkdef -f removes an existing definition.
  • Preserve valid paths where the condition is satisfied explicitly, from existing DB attributes, or by group inheritance.
  • Add focused unit coverage for only_if matching and mkdef regression cases for partial writes and -f preservation.

Validation

  • prove -v xCAT-test/unit/dbobjutils_only_if.t
  • perl -c perl-xCAT/xCAT/DBobjUtils.pm
  • XCATROOT=/opt/xcat PERL5LIB=perl-xCAT:xCAT-server/lib/perl:xCAT-server/lib perl -c xCAT-server/lib/xcat/plugins/DBobjectdefs.pm
  • git diff --check
  • Direct temporary SQLite xCAT DB checks for invalid, valid, and mixed valid/invalid object writes.

perlcritic --severity 5 still reports existing findings already present on master; this patch did not introduce a new severity-5 class of issue in the touched files.

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

Copy link
Copy Markdown

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: 3c16d99bb8

ℹ️ 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 perl-xCAT/xCAT/DBobjUtils.pm Outdated
@viniciusferrao viniciusferrao force-pushed the fix/mkdef-partial-object-on-validation-error branch 3 times, most recently from c2e1827 to f006dc6 Compare April 27, 2026 05:16
@viniciusferrao viniciusferrao marked this pull request as draft April 27, 2026 13:25
@viniciusferrao viniciusferrao force-pushed the fix/mkdef-partial-object-on-validation-error branch 4 times, most recently from 1a7df26 to 87deda2 Compare April 27, 2026 16:12
@viniciusferrao viniciusferrao marked this pull request as ready for review April 27, 2026 16:18
@VersatusHPC VersatusHPC deleted a comment from chatgpt-codex-connector Bot Apr 27, 2026
@viniciusferrao viniciusferrao marked this pull request as draft April 27, 2026 19:16
@viniciusferrao viniciusferrao force-pushed the fix/mkdef-partial-object-on-validation-error branch 2 times, most recently from 408e37a to a617035 Compare May 5, 2026 00:20
@viniciusferrao viniciusferrao force-pushed the fix/mkdef-partial-object-on-validation-error branch from a617035 to 2ae97c2 Compare May 6, 2026 23:41
@viniciusferrao viniciusferrao merged commit 5463a7c into master May 7, 2026
1 check passed
@viniciusferrao viniciusferrao deleted the fix/mkdef-partial-object-on-validation-error branch May 7, 2026 21:10
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.

mkdef complains with error, but it still allows the node definition to be created

1 participant