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

feat(devservices): Return namedtuple for docker compose command #183

Merged

Conversation

hubertdeng123
Copy link
Member

This allows us to determine the project name, services list, and config file path of each docker compose command. It removes hacky logic from up/down to obtain dependency names, and allows us to be more flexible in the future

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.33%. Comparing base (0cbaae9) to head (f5185f3).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #183      +/-   ##
==========================================
- Coverage   92.48%   92.33%   -0.16%     
==========================================
  Files          22       22              
  Lines        1344     1369      +25     
==========================================
+ Hits         1243     1264      +21     
- Misses        101      105       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -14,7 +15,6 @@
DEVSERVICES_DEPENDENCIES_CACHE_DIR_KEY = "DEVSERVICES_DEPENDENCIES_CACHE_DIR"
STATE_DB_FILE = os.path.join(DEVSERVICES_LOCAL_DIR, "state")
DEVSERVICES_ORCHESTRATOR_LABEL = "orchestrator=devservices"
DOCKER_COMPOSE_COMMAND_LENGTH = 7
Copy link
Member

Choose a reason for hiding this comment

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

Thank goodness we can finally get rid of this 😌

Comment on lines 43 to 47
class DockerComposeCommand(NamedTuple):
full_command: list[str]
project_name: str
config_path: str
services: list[str]
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this belongs here. Shouldn't this live in docker_compose.py?

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 will move

@hubertdeng123 hubertdeng123 merged commit 2480c75 into main Dec 19, 2024
12 of 13 checks passed
@hubertdeng123 hubertdeng123 deleted the hubertdeng123/use-namedtuple-docker-compose-command branch December 19, 2024 17:44
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