Skip to content

Comments

Removes dead code for conflict-test#1797

Merged
schnie merged 8 commits intomainfrom
remove-conflict-test-dead-code
Feb 11, 2025
Merged

Removes dead code for conflict-test#1797
schnie merged 8 commits intomainfrom
remove-conflict-test-dead-code

Conversation

@schnie
Copy link
Member

@schnie schnie commented Jan 30, 2025

Description

This PR removes some seemingly dead code. This conflictTest variable will always evaluate to false, so we're removing all the code that would run if we branched on this value being true. Seems like it used to be a flag that we've removed along the way. Not sure how else this code would ever run.

Update: I found this digging through the history. Looks like we intentionally removed the functionality, but didn't remove the dead code. @kushalmalani even suggested it here.

🎟 Issue(s)

No issue, just noticed while looking at other things.

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

)

const (
EchoCmd = "echo"
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated, but also unused.

envExport bool
noBrowser bool
compose bool
conflictTest bool
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see anywhere in our code that sets this variable. It used to exist at one time as a flag, but doesn't anymore. This would always evaluate to false, so we remove the code that branches if this value is true.

Comment on lines -602 to -607
if conflictTest {
err = d.conflictTest(testHomeDirectory, newImageName, newAirflowVersion)
if err != nil {
return err
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Nowhere in our code base do we seem to set conflictTest to true. There should be no way for this branch to ever run. This conflictTest used to exist as a flag on the CLI commands, but seems to have been removed.

@schnie schnie force-pushed the remove-conflict-test-dead-code branch from b1ca490 to e0230f8 Compare January 30, 2025 20:34
@schnie schnie marked this pull request as ready for review January 31, 2025 16:30
@schnie schnie mentioned this pull request Jan 31, 2025
8 tasks
Copy link
Contributor

@kushalmalani kushalmalani left a comment

Choose a reason for hiding this comment

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

Thank you @schnie ❤️

@schnie schnie merged commit 3af9c2d into main Feb 11, 2025
3 of 4 checks passed
@schnie schnie deleted the remove-conflict-test-dead-code branch February 11, 2025 14:46
BasPH pushed a commit that referenced this pull request Feb 20, 2025
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.

3 participants