Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes dead code for conflict-test #1797

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

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

@@ -30,7 +30,6 @@ import (
)

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.

@@ -60,7 +60,6 @@ var (
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 ❤️

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