Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
649 changes: 649 additions & 0 deletions SHELL_DEPENDENCY_MAP.md

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions django_mongodb_cli/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,28 @@ def log(
all_repos: bool = typer.Option(
False, "--all-repos", "-a", help="Show logs of all repositories"
),
n: int = typer.Option(
10,
"-n",
"--lines",
min=1,
help="Number of log entries to show (per repository)",
),
):
"""
Show logs for the specified repository.

By default, shows the last 10 entries. Use ``-n/--lines`` to change the
number of entries displayed (per repository).
If --all-repos is used, show logs for all repositories.
"""
repo_command(
all_repos,
repo_name,
all_msg="Showing logs for all repositories...",
missing_msg="Please specify a repository name or use --all-repos to show logs of all repositories.",
single_func=lambda repo_name: Repo().get_repo_log(repo_name),
all_func=lambda repo_name: Repo().get_repo_log(repo_name),
single_func=lambda repo_name: Repo().get_repo_log(repo_name, n),
all_func=lambda repo_name: Repo().get_repo_log(repo_name, n),
)


Expand Down
12 changes: 8 additions & 4 deletions django_mongodb_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,13 @@ def fetch_repo(self, repo_name: str) -> None:
except GitCommandError as e:
self.err(f"❌ Failed to fetch updates: {e}")

def get_repo_log(self, repo_name: str) -> None:
"""
Get the commit log for the specified repository.
def get_repo_log(self, repo_name: str, max_lines: int | None = None) -> None:
"""Print the commit log for the specified repository.

Args:
repo_name: Logical name of the repository.
max_lines: Maximum number of log entries to display. If ``None``,
a default of 10 entries is used.
"""
self.info(f"Getting commit log for repository: {repo_name}")
_, repo = self.ensure_repo(repo_name)
Expand All @@ -293,7 +297,7 @@ def get_repo_log(self, repo_name: str) -> None:
"--date=relative",
"--graph",
).splitlines()
log_max = 10
log_max = max_lines if max_lines is not None else 10
for count, entry in enumerate(log_entries, start=1):
typer.echo(f" - {entry}")
if count >= log_max:
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ alias s := django-runserver

[group('django')]
django-migrate:
dm proj migrate
dm project migrate
alias m := django-migrate

[group('django')]
django-createsuperuser:
dm proj su
dm project su
alias su := django-createsuperuser

# ---------------------------------------- mongodb ----------------------------------------
Expand Down
26 changes: 23 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,25 @@ test_dir = "src/django/tests"
clone_dir = "src/django"
test_dirs = [ "src/django/tests", "src/django-mongodb-backend/tests" ]

[[tool.django-mongodb-cli.test.django.env_vars]]
name = "PYMONGOCRYPT_LIB"
value = "/opt/homebrew/lib/libmongocrypt.dylib"
#[[tool.django-mongodb-cli.test.django.env_vars]]
#name = "PYMONGOCRYPT_LIB"
#value = "/opt/homebrew/lib/libmongocrypt.dylib"

#[[tool.django-mongodb-cli.test.django.env_vars]]
#name = "MONGODB_URI"
#value = "mongodb://localhost:64437/?directConnection=true"

[[tool.django-mongodb-cli.run.mongo-python-driver.env_vars]]
name = "DRIVERS_TOOLS"
value = "/Users/alex.clark/Developer/django-mongodb-cli/src/drivers-evergreen-tools"

#[[tool.django-mongodb-cli.run.mongo-python-driver.env_vars]]
#name = "MONGODB_URI"
#value = "mongodb://localhost:64437/?directConnection=true"

[[tool.django-mongodb-cli.run.mongo-python-driver.env_vars]]
name = "AWS_PROFILE"
value = "my-profile"

[[tool.django-mongodb-cli.test.django.env_vars]]
name = "MONGODB_URI"
Expand Down Expand Up @@ -363,6 +379,10 @@ repo = "git+ssh://git@github.com/mongodb/django-mongodb-backend"
project_name = "django-mongodb"
tasks = ["run-tests"]

[tool.django-mongodb-cli.evergreen.mongo-python-driver]
project_name = "mongo-python-driver"
tasks = ["run-tests"]

[tool.django-mongodb-cli.project.settings]
# path = "settings.base"
path = "settings.qe"
9 changes: 4 additions & 5 deletions test/settings/qe.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
KMS_CREDENTIALS = {"aws": {"key": _AWS_KEY_ARN, "region": _AWS_REGION}}
DEFAULT_KMS_PROVIDER = "aws"
else:
pass
# Local-only fallback: matches the original configuration.
# KMS_PROVIDERS = {"local": {"key": os.urandom(96)}}
# KMS_CREDENTIALS = {"aws": {}}
# DEFAULT_KMS_PROVIDER = "local"
# Local-only fallback
KMS_PROVIDERS = {"local": {"key": os.urandom(96)}}
KMS_CREDENTIALS = {"local": {}}
DEFAULT_KMS_PROVIDER = "local"


DATABASES = {
Expand Down