Skip to content

scheduling: refactor send_messages to de-duplicate code path#3271

Merged
sgoggins merged 1 commit intochaoss:mainfrom
MoralCode:collection_util-duplicate-code
Sep 16, 2025
Merged

scheduling: refactor send_messages to de-duplicate code path#3271
sgoggins merged 1 commit intochaoss:mainfrom
MoralCode:collection_util-duplicate-code

Conversation

@MoralCode
Copy link
Contributor

@MoralCode MoralCode commented Sep 15, 2025

Description
in looking for the facade scheduling issues, I noticed a couple structural (not functional) issues that arent directly going to solve the core problem but just help to clean up the code so its more readable when trying to debug the facade issues

  1. This code path was almost entirely duplicated in two branches of an if-else chain.
  2. the catch-all else block was being used for gitlab, potentially blocking any future additional sources

This essentially moves the actual "meat" of this function to below the if-else chain and extracts a couple new variables to abstract the differences between the two implementations (i.e. changing which list of phases gets used, and also printing the correct platform name in log messages)

Signed commits

  • Yes, I signed my commits.

@MoralCode MoralCode changed the title refactor send_messages to remove a almost entirely duplicate code path scheduling: refactor send_messages to remove a almost entirely duplicate code path Sep 15, 2025
@MoralCode MoralCode force-pushed the collection_util-duplicate-code branch from 8825895 to 8dfe1f7 Compare September 15, 2025 17:16
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
@MoralCode MoralCode force-pushed the collection_util-duplicate-code branch from 8dfe1f7 to 33debfd Compare September 15, 2025 17:21
@MoralCode
Copy link
Contributor Author

interestingly, this change was discovered when I asked gemini for some help tracking down the facade changes. It made a code change and, when describing the changes, said "The same logic is applied to GitLab phases." - prompting me to go see what the differences were between the two implementations before realizing they could be deduplicated

@MoralCode MoralCode changed the title scheduling: refactor send_messages to remove a almost entirely duplicate code path scheduling: refactor send_messages to de-duplicate code path Sep 16, 2025
Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

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

LGTM!

@sgoggins sgoggins merged commit c8f22bb into chaoss:main Sep 16, 2025
10 checks passed
MoralCode added a commit that referenced this pull request Sep 23, 2025
…cate-code"

This reverts commit c8f22bb, reversing
changes made to fefb48a.
sgoggins added a commit that referenced this pull request Sep 23, 2025
skools-here pushed a commit to skools-here/augur that referenced this pull request Oct 15, 2025
…-duplicate-code"

This reverts commit c8f22bb, reversing
changes made to fefb48a.

Signed-off-by: Sajal-Kulshreshtha <sajalkulshreshtha9@gmail.com>
Ulincsys pushed a commit that referenced this pull request Oct 22, 2025
…cate-code"

This reverts commit c8f22bb, reversing
changes made to fefb48a.
@MoralCode MoralCode deleted the collection_util-duplicate-code branch November 19, 2025 14:25
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