Skip to content

Pass the original node content to adjust decision callback - #287

Draft
happz wants to merge 2 commits into
mainfrom
adjust-decision-sees-original
Draft

Pass the original node content to adjust decision callback#287
happz wants to merge 2 commits into
mainfrom
adjust-decision-sees-original

Conversation

@happz

@happz happz commented Jun 25, 2025

Copy link
Copy Markdown
Contributor

Because I would really like to show the diff between "before" and "after", and callback was getting just one version.

Checklist

  • implement the feature

Comment thread fmf/base.py
@happz
happz force-pushed the adjust-decision-sees-original branch from 94d7aab to e258835 Compare June 25, 2025 14:43
Comment thread fmf/base.py
self._merge_special(self.data, apply_rule)

if decision_callback:
node_before = self.copy()

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.

Should it deep_copy instead in case the merge changes something like a list, or is that already taken care of?

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.

I thought there's deepcopy used, but when I play with it I see no change between before and after, and I suspect the copy is not as deep as I expected...

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.

Nevermind, deepcopy is there, and what I saw was PEBKAC.

@happz
happz marked this pull request as draft June 25, 2025 14:55
@happz

happz commented Jun 25, 2025

Copy link
Copy Markdown
Contributor Author

An example of tmt output when this becomes available - it borrows from the similar output of --log-topic=policy, note the "diff" of keys after a rule applies.

2025-06-25_23-02

@happz happz added this to planning Jul 3, 2025
@github-project-automation github-project-automation Bot moved this to backlog in planning Jul 3, 2025
@happz happz moved this from backlog to implement in planning Jul 3, 2025
Because I would really like to show the diff between "before" and
"after", and callback was getting just one version.
@happz
happz force-pushed the adjust-decision-sees-original branch from e258835 to f68c905 Compare August 19, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: implement

Development

Successfully merging this pull request may close these issues.

2 participants