⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@Tahoora-Tabassum
Copy link

@Tahoora-Tabassum Tahoora-Tabassum commented Jan 29, 2026

Pull Request

Description

This PR resolves linting issues reported by ruff and introduces an optional verbose parameter to control download log output.

What this PR does

  • Fixes unused variable and import issues flagged by ruff
  • Adds a verbose parameter to the download logic to optionally print progress logs
  • Ensures all lint checks pass locally and in CI

Why

  • CI was failing due to unused variables and imports
  • Logging needed to be optional to avoid unnecessary console output in non-verbose usage

Related Issues

Fixes #27 (supersedes earlier PR with CI failures)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Housekeeping

Checklist

  • My code follows the ruff code style of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • No documentation update required
  • New and existing unit tests pass locally
    • python -m ruff check . — all checks passed

Summary by CodeRabbit

  • Chores
    • Updated internal dependencies and test infrastructure with no user-facing changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

A submodule reference for databus-python-client is updated to a new commit. Additionally, an import alias for databusclient.client is introduced in the test download module, marked with Git conflict indicators.

Changes

Cohort / File(s) Summary
Submodule Update
databus-python-client
Submodule reference updated to commit 189458ec1f673c55f66b97d43b5507c648230f47 with no functional code changes.
Test Imports
tests/test_download.py
Added import alias import databusclient.client as cl with Git conflict markers; no changes to existing test logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The submodule update (databus-python-client) and test import alias addition appear disconnected from the stated objectives of fixing linting issues and adding verbose logging. Clarify whether the submodule update and test import alias changes are necessary for the verbose logging feature, or if they should be separated into a different PR.
Linked Issues check ❓ Inconclusive The PR addresses issue #27 by introducing verbose parameter functionality to control download log output, partially fulfilling the objective of exposing HTTP request/response information when enabled. Verify that the verbose parameter exposes detailed HTTP request/response information from Databus/Vault as required in issue #27, not just progress logs.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: fixing verbose logging and removing unused variables/imports for CI, which aligns with the PR objectives.
Description check ✅ Passed The PR description covers key sections including objectives, type of change, and checklist items, though it lacks a formal 'Related Issues' section matching the template structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
databus-python-client (4)

1-6: Major inconsistency between PR objectives and submodule commit content.

The PR title states "Fix verbose logging and remove unused variables/imports for CI" and the description mentions resolving ruff linting issues and introducing a verbose parameter. However, this submodule commit (189458e) is titled "cli: add mkdist validations, completion helper, tests and docs" and introduces entirely new CLI functionality (mkdist and completion commands).

This appears to be the wrong submodule commit reference for this PR's stated objectives. Please verify that the correct commit is being referenced.


65-105: Remove duplicate documentation sections.

Lines 86-105 are an exact duplicate of lines 65-85, repeating the mkdist and completion command documentation. This duplication should be removed to maintain clean documentation.

📝 Proposed fix

Remove lines 86-105 entirely as they duplicate the content already present in lines 65-85.


159-163: Remove redundant import of json module.

The json module is already imported at line 114, but line 160 imports it again as _json. This is unnecessary.

♻️ Proposed fix
     dist = client.create_distribution(url=url, cvs=sorted_cvs, file_format=file_format, compression=compression, sha256_length_tuple=sha_tuple)
     if json_output:
-        import json as _json
-        click.echo(_json.dumps({"distribution": dist}))
+        click.echo(json.dumps({"distribution": dist}))
     else:
         click.echo(dist)

24-60: Do not rename --version-id to --versionid—it violates CLI conventions and breaks backward compatibility.

The proposed change to rename the parameter from kebab-case (--version-id) to a single word (--versionid) breaks the standard CLI naming convention and will break existing scripts and workflows. If this rename is intentional, it must be clearly documented as a breaking change and justified. Otherwise, keep the parameter as --version-id to maintain backward compatibility and follow established CLI conventions.

🧹 Nitpick comments (1)
databus-python-client (1)

179-221: Consider adding tests for additional validation scenarios.

The current tests cover the happy path and basic error cases, but several validation branches remain untested:

  1. Duplicate CV key detection (cli.py line 143-145)
  2. Forbidden characters in CV keys like | or _ (cli.py line 141-142)
  3. JSON output option (--json-output flag, cli.py line 132)
  4. Edge cases with missing optional parameters

Adding these tests would improve coverage and prevent regressions in the validation logic.

📋 Example tests to add
def test_mkdist_duplicate_cv_key():
    runner = CliRunner()
    res = runner.invoke(cli.app, [
        'mkdist', 'https://example.org/file',
        '--cv', 'lang=en',
        '--cv', 'lang=fr'  # duplicate key
    ])
    assert res.exit_code != 0
    assert 'Duplicate content-variant key' in res.output

def test_mkdist_forbidden_characters_in_cv_key():
    runner = CliRunner()
    res = runner.invoke(cli.app, [
        'mkdist', 'https://example.org/file',
        '--cv', 'la|ng=en'  # forbidden | character
    ])
    assert res.exit_code != 0
    assert 'Invalid characters' in res.output

def test_mkdist_json_output():
    runner = CliRunner()
    res = runner.invoke(cli.app, [
        'mkdist', 'https://example.org/file',
        '--cv', 'lang=en',
        '--json-output'
    ])
    assert res.exit_code == 0
    import json
    data = json.loads(res.output)
    assert 'distribution' in data

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/test_download.py`:
- Around line 2-5: Remove the Git merge conflict markers (<<<<<<< HEAD, =======,
>>>>>>> main) from tests/test_download.py and resolve the conflict by keeping
the intended import or deleting it; specifically decide whether the import
statement "import databusclient.client as cl" is required by the tests—if not,
remove that unused import; ensure the file has no conflict markers and imports
only what tests use so test collection and linting succeed.

Comment on lines +2 to +5
<<<<<<< HEAD
import databusclient.client as cl
=======
>>>>>>> main
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Resolve merge conflict markers; file is currently invalid.

The <<<<<<<, =======, >>>>>>> markers will break test collection and linting. Resolve the conflict and remove the unused import unless it’s actually needed.

🧩 Proposed fix
-<<<<<<< HEAD
-import databusclient.client as cl
-=======
->>>>>>> main
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<<<<<<< HEAD
import databusclient.client as cl
=======
>>>>>>> main
🤖 Prompt for AI Agents
In `@tests/test_download.py` around lines 2 - 5, Remove the Git merge conflict
markers (<<<<<<< HEAD, =======, >>>>>>> main) from tests/test_download.py and
resolve the conflict by keeping the intended import or deleting it; specifically
decide whether the import statement "import databusclient.client as cl" is
required by the tests—if not, remove that unused import; ensure the file has no
conflict markers and imports only what tests use so test collection and linting
succeed.

@Integer-Ctrl
Copy link
Contributor

Integer-Ctrl commented Jan 31, 2026

Hi @Tahoora-Tabassum!

It looks like something has gone wrong. The changes that have been made appear quite strange.

coderabbitai often spots such problems. So bear in mind that you should also see its review.

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.

verbose param

2 participants