Skip to content

Add CLI Command to Check Deployment Prerequisites #1

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

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

Conversation

BenCodeOcean
Copy link
Contributor

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new CLI command to check deployment prerequisites for Code Ocean. It introduces a new package structure with multiple modules for prerequisite checks, integrates a CLI entry point via setup.py, and updates documentation with installation and usage examples.

  • Added a new command 'check-prerequisites' under co_support/prerequisites/.
  • Implemented various prerequisite check functions (access, network, quota, domain) and rendering logic.
  • Updated setup configuration and README with CLI usage instructions.

Reviewed Changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
setup.py Configures the package and registers the CLI entry point
co_support/prerequisites/main.py Registers and implements the 'check-prerequisites' command
co_support/prerequisites/core/* Implements question, render, prerequisite, and constants APIs
co_support/prerequisites/checks/* Implements AWS checks for quotas, network, domain, and access
co_support/main.py & co_support/cmd.py Integrates the CLI command into the overall command handler
README.md Provides updated installation and usage instructions
Files not reviewed (1)
  • co_support/requirements.txt: Language not supported

@BenCodeOcean BenCodeOcean requested a review from Copilot April 3, 2025 09:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new CLI command "check-prerequisites" to verify various deployment requirements for Code Ocean. Key changes include:

  • Introduction of a CLI command registered under co_support/prerequisites/main.py.
  • Implementation of multiple prerequisite checks (access, network, quota, domain) in dedicated modules.
  • Updates to setup.py, README.md, and command infrastructure to support the new CLI functionality.

Reviewed Changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
setup.py Defines package metadata and CLI entry point for co-support.
co_support/prerequisites/main.py Registers the new "check-prerequisites" CLI command.
co_support/prerequisites/core/render.py Adds functions to render output in YAML or table format.
co_support/prerequisites/core/questions.py Implements interactive and silent modes for collecting inputs.
co_support/prerequisites/core/prerequisite.py Defines the prerequisite check abstraction.
co_support/prerequisites/core/constants.py Provides shared constants and AWS session helpers.
co_support/prerequisites/core/checks.py Aggregates and executes all defined prerequisite checks.
co_support/prerequisites/checks/quota.py Checks vCPU and Elastic IP quotas.
co_support/prerequisites/checks/network.py Validates VPC configurations, subnets, and internet routing.
co_support/prerequisites/checks/domain.py Checks hosted zone configurations and certificate validity.
co_support/prerequisites/checks/access.py Checks service-linked roles and admin access policies.
co_support/main.py Bootstraps the CLI by wiring up the subcommand handlers.
co_support/cmd.py Provides a BaseCommand class for implementing CLI commands.
README.md Documents installation and usage of the new CLI command.
Files not reviewed (1)
  • co_support/requirements.txt: Language not supported

self.parser.set_defaults(cmd=self.cmd)

@abstractmethod
def cmd(args):
Copy link
Preview

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

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

The abstract method 'cmd' is missing the 'self' parameter. Change it to 'def cmd(self, args):' to correctly define an instance method.

Suggested change
def cmd(args):
def cmd(self, args):

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Retrieves the answer to a specific question.
"""
global _answers
if _answers is None:
Copy link
Preview

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

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

The global variable '_answers' is referenced in get_answer without an explicit module-level initialization, which could lead to a NameError if ask_questions is not called first. Consider initializing '_answers' at the module level.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

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.

1 participant