-
Notifications
You must be signed in to change notification settings - Fork 9
cli: add mkdist validations and completion helper #43
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
base: main
Are you sure you want to change the base?
cli: add mkdist validations and completion helper #43
Conversation
📝 WalkthroughWalkthroughAdds two CLI commands— Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (3)
README.md (1)
306-307: Consider adding language specifiers to fenced code blocks.The markdown linter suggests adding language identifiers (e.g.,
bash,shell) to fenced code blocks for better syntax highlighting and rendering.Also applies to: 311-312, 318-319, 327-328, 332-333, 339-340
tests/test_cli.py (1)
38-42: Consider adding a test for the completion command without arguments.The current test validates the completion command with an explicit 'bash' argument. Consider adding a test for the default behavior when no shell argument is provided, as there appears to be a potential issue with the default parameter handling in
databusclient/cli.py(see my comment there).🔎 Suggested additional test
def test_completion_no_arg(): runner = CliRunner() res = runner.invoke(cli.app, ['completion']) assert res.exit_code == 0 assert '_DATABUSCLIENT_COMPLETE' in res.outputdatabusclient/cli.py (1)
155-159: Consider enhancing the completion command.The current implementation only prints instructions for enabling shell completion. Users might expect the command to output actual completion scripts that can be evaluated directly. Consider providing actual completion script generation or clarifying in the help text that this command only shows setup instructions.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.mddatabusclient/cli.pytest.shtests/test_cli.py
🧰 Additional context used
🧬 Code graph analysis (2)
tests/test_cli.py (1)
databusclient/cli.py (1)
app(13-15)
databusclient/cli.py (1)
databusclient/client.py (1)
create_distribution(174-205)
🪛 markdownlint-cli2 (0.18.1)
README.md
210-210: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
306-306: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
311-311: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
318-318: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
327-327: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
332-332: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
336-336: Multiple headings with the same content
(MD024, no-duplicate-heading)
339-339: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🪛 Ruff (0.14.10)
databusclient/cli.py
128-128: Avoid specifying long messages outside the exception class
(TRY003)
131-131: Avoid specifying long messages outside the exception class
(TRY003)
133-133: Avoid specifying long messages outside the exception class
(TRY003)
140-140: Avoid specifying long messages outside the exception class
(TRY003)
🔇 Additional comments (10)
test.sh (1)
4-4: LGTM!The flag rename from
--version-idto--versionidis consistent with the CLI changes indatabusclient/cli.py.README.md (2)
188-190: LGTM!The option rename from
--version-idto--versionidis correctly reflected in the documentation.
207-212: LGTM!The updated examples correctly use the new
--versionidflag.tests/test_cli.py (3)
5-19: LGTM! Excellent test coverage for the mkdist command.The test correctly validates:
- Multiple
--cvflags are accepted- Content variants are sorted alphabetically in the output (
a=1beforeb=2)- All components (format, compression, sha-length) are properly formatted in the output
22-26: LGTM! Good validation of invalid content variant format.The test correctly ensures that invalid CV format (missing
=separator) produces a non-zero exit code and appropriate error message.
29-35: LGTM! Good validation of invalid SHA format.The test correctly ensures that invalid SHA-length format produces a non-zero exit code and appropriate error message.
databusclient/cli.py (4)
6-6: LGTM!The
remodule import is appropriately added to support SHA-256 validation using regex patterns in themkdistcommand.
20-20: LGTM!The option rename from
--version-idto--versionidis consistent across the codebase (tests, documentation, and this implementation).
115-147: LGTM! Solid validation logic for the mkdist command.The implementation correctly:
- Validates CV format (key=value with no
|or_in keys)- Enforces unique CV keys
- Validates SHA-length format (64 hex chars + colon + integer)
- Ensures deterministic ordering by sorting CVs alphabetically
- Properly constructs the distribution string via
client.create_distribution
128-128: Static analysis hint about exception messages can be safely ignored.The Ruff linter (TRY003) suggests avoiding long messages in exceptions, but in this CLI context, raising
click.BadParameterwith descriptive user-facing messages is the recommended Click pattern for validation errors. This is not an issue.Also applies to: 131-131, 133-133, 140-140
| if json_output: | ||
| import json as _json | ||
| click.echo(_json.dumps({"distribution": dist})) | ||
| else: | ||
| click.echo(dist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove redundant local import.
The json module is already imported at line 2. The local import import json as _json on line 149 is unnecessary and can cause confusion.
🔎 Proposed fix
Since json is already imported at the module level (line 2), use it directly:
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)📝 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.
| if json_output: | |
| import json as _json | |
| click.echo(_json.dumps({"distribution": dist})) | |
| else: | |
| click.echo(dist) | |
| if json_output: | |
| click.echo(json.dumps({"distribution": dist})) | |
| else: | |
| click.echo(dist) |
🤖 Prompt for AI Agents
In databusclient/cli.py around lines 148 to 152, there is a redundant local
import "import json as _json" even though json is already imported at the module
level; remove the local import and use the module-level json directly (replace
_json.dumps with json.dumps or simply call json.dumps) so the code echoes JSON
without the unnecessary alias.
| @app.command() | ||
| @click.argument("shell", type=click.Choice(["bash","zsh","fish","powershell"]), required=False) | ||
| def completion(shell="bash"): | ||
| click.echo(f"Run: eval \"$(_DATABUSCLIENT_COMPLETE=source_{shell} python -m databusclient)\"") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix default parameter behavior.
When no argument is provided to the completion command, Click will pass None (not "bash") because the argument is marked required=False. The default value in the function signature shell="bash" is never used in this scenario.
🔎 Proposed fix
Handle the None case explicitly or set a default in the function body:
@app.command()
@click.argument("shell", type=click.Choice(["bash","zsh","fish","powershell"]), required=False)
-def completion(shell="bash"):
+def completion(shell):
+ if shell is None:
+ shell = "bash"
click.echo(f"Run: eval \"$(_DATABUSCLIENT_COMPLETE=source_{shell} python -m databusclient)\"")🤖 Prompt for AI Agents
In databusclient/cli.py around lines 155 to 159, the completion command assumes
a default "bash" via the function signature but Click passes None when the
argument is omitted; update the function to accept shell=None (or keep
signature) and explicitly set shell = shell or "bash" at the start of the
function (or check if shell is None then assign "bash") before using it in the
echo so the default is applied correctly when no argument is provided.
| ### mkdist command | ||
|
|
||
| Create a distribution string from components. | ||
|
|
||
| Usage: | ||
| ``` | ||
| databusclient mkdist URL --cv key=value --cv key2=value2 --format ttl --compression gz --sha-length <sha256hex>:<length> | ||
| ``` | ||
|
|
||
| Example: | ||
| ``` | ||
| python -m databusclient mkdist "https://example.org/file.ttl" --cv lang=en --cv part=sorted --format ttl --compression gz --sha-length aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:12345 | ||
| ``` | ||
|
|
||
| ## Completion | ||
|
|
||
| Enable shell completion (bash example): | ||
| ``` | ||
| eval "$(_DATABUSCLIENT_COMPLETE=source_bash python -m databusclient)" | ||
| ``` | ||
|
|
||
| ### mkdist command | ||
|
|
||
| Create a distribution string from components. | ||
|
|
||
| Usage: | ||
| ``` | ||
| databusclient mkdist URL --cv key=value --cv key2=value2 --format ttl --compression gz --sha-length <sha256hex>:<length> | ||
| ``` | ||
|
|
||
| Example: | ||
| ``` | ||
| python -m databusclient mkdist "https://example.org/file.ttl" --cv lang=en --cv part=sorted --format ttl --compression gz --sha-length aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:12345 | ||
| ``` | ||
|
|
||
| ## Completion | ||
|
|
||
| Enable shell completion (bash example): | ||
| ``` | ||
| eval "$(_DATABUSCLIENT_COMPLETE=source_bash python -m databusclient)" | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate documentation sections.
The mkdist command documentation (lines 301-314 and 322-335) and Completion documentation (lines 315-321 and 336-342) appear twice in the file. Please remove the duplicate sections.
🔎 Proposed fix
Remove lines 322-342 to eliminate the duplication:
-### mkdist command
-
-Create a distribution string from components.
-
-Usage:
-```
-databusclient mkdist URL --cv key=value --cv key2=value2 --format ttl --compression gz --sha-length <sha256hex>:<length>
-```
-
-Example:
-```
-python -m databusclient mkdist "https://example.org/file.ttl" --cv lang=en --cv part=sorted --format ttl --compression gz --sha-length aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:12345
-```
-
-## Completion
-
-Enable shell completion (bash example):
-```
-eval "$(_DATABUSCLIENT_COMPLETE=source_bash python -m databusclient)"
-```
-🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
306-306: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
311-311: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
318-318: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
327-327: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
332-332: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
336-336: Multiple headings with the same content
(MD024, no-duplicate-heading)
339-339: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In README.md around lines 301 to 342 there are duplicate "mkdist command" and
"Completion" sections; remove the repeated block (lines 322-342) so only one
instance of the mkdist usage/example and one Completion section remain, ensuring
surrounding spacing and formatting stay consistent after deletion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (3)
README.md (1)
522-563: Remove duplicate documentation sections.The mkdist command documentation and Completion documentation sections appear twice (lines 522-542 and 543-563). This issue was previously identified and should be resolved by removing the duplicate sections.
databusclient/cli.py (2)
250-254: Remove redundant local import.The
jsonmodule is already imported at line 2. The local importimport json as _jsonat line 251 is unnecessary. This issue was previously identified.
257-260: Fix default parameter behavior.When no argument is provided to the
completioncommand, Click passesNone(not"bash") because the argument is markedrequired=False. The default value in the function signature is not used in this scenario. This issue was previously identified.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
README.mddatabusclient/cli.py
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md
321-321: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
325-325: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
527-527: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
532-532: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
539-539: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
548-548: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
553-553: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
557-557: Multiple headings with the same content
(MD024, no-duplicate-heading)
560-560: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
| @app.command() | ||
| @click.argument("url") | ||
| @click.option("--cv", "cvs", multiple=True, help="Content variant like key=value (repeatable). Keys must not contain '|' or '_'") | ||
| @click.option("--format", "file_format", help="Format extension (e.g. ttl)") | ||
| @click.option("--compression", help="Compression (e.g. gzip)") | ||
| @click.option("--sha-length", help="sha256:length (64 hex chars followed by ':' and integer length)") | ||
| @click.option("--json-output", is_flag=True, help="Output JSON distribution object instead of plain string") | ||
| def mkdist(url, cvs, file_format, compression, sha_length, json_output): | ||
| """Create a distribution string from components.""" | ||
| # Validate CVs | ||
| cvs_dict = {} | ||
| for cv in cvs: | ||
| if "=" not in cv: | ||
| raise click.BadParameter(f"Invalid content variant '{cv}': expected key=value") | ||
| key, val = cv.split("=", 1) | ||
| if any(ch in key for ch in ("|", "_")): | ||
| raise click.BadParameter("Invalid characters in content-variant key (forbidden: '|' and '_')") | ||
| if key in cvs_dict: | ||
| raise click.BadParameter(f"Duplicate content-variant key '{key}'") | ||
| cvs_dict[key] = val | ||
|
|
||
| # Validate sha-length | ||
| sha_tuple = None | ||
| if sha_length: | ||
| if not re.match(r'^[A-Fa-f0-9]{64}:\d+$', sha_length): | ||
| raise click.BadParameter("Invalid --sha-length; expected SHA256HEX:length") | ||
| sha, length = sha_length.split(":", 1) | ||
| sha_tuple = (sha, int(length)) | ||
|
|
||
| # Deterministic ordering | ||
| sorted_cvs = {k: cvs_dict[k] for k in sorted(cvs_dict)} | ||
|
|
||
| dist = api_deploy.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})) | ||
| else: | ||
| click.echo(dist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Find the api_deploy module and create_distribution function
find . -name "*.py" -type f | xargs grep -l "def create_distribution" 2>/dev/nullRepository: dbpedia/databus-python-client
Length of output: 102
🏁 Script executed:
# Search for distribution string parsing/parsing logic
rg -n "parse.*distribution|distribution.*parse" --type=py -A 3 -B 3Repository: dbpedia/databus-python-client
Length of output: 55
🏁 Script executed:
# Search for how distribution strings are split or used with "|" and "_"
rg -n "split.*['\"]\\|['\"]|split.*['\"]_['\"]" --type=py -A 5 -B 3Repository: dbpedia/databus-python-client
Length of output: 4006
🏁 Script executed:
# Look at the api_deploy module structure
find . -path "*/api_deploy*" -type f 2>/dev/null | head -20Repository: dbpedia/databus-python-client
Length of output: 55
🏁 Script executed:
rg -n "def create_distribution" --type=py -A 50 databusclient/api/deploy.pyRepository: dbpedia/databus-python-client
Length of output: 2307
🏁 Script executed:
# Also check if there's any encoding/escaping of CV values in the create_distribution function
rg -n "def create_distribution|def mkdist|encode|escape" --type=py -B 2 -A 20 databusclient/api/deploy.pyRepository: dbpedia/databus-python-client
Length of output: 1230
Validate content-variant values for forbidden characters.
The validation at lines 232-233 correctly forbids "|" and "" in content-variant keys, but it does not validate the values. Since the distribution string format (url|key1=value1_key2=value2|format|compression|sha:length) uses "|" as a field separator and "" as a CV pair separator, allowing these characters in values will break downstream parsing. For example, a value containing "_" would be split incorrectly at line 38 in _get_content_variants(), and a value containing "|" would disrupt the initial split at line 28, creating malformed distribution strings.
Add validation for values:
for cv in cvs:
if "=" not in cv:
raise click.BadParameter(f"Invalid content variant '{cv}': expected key=value")
key, val = cv.split("=", 1)
if any(ch in key for ch in ("|", "_")):
raise click.BadParameter("Invalid characters in content-variant key (forbidden: '|' and '_')")
+ if any(ch in val for ch in ("|", "_")):
+ raise click.BadParameter("Invalid characters in content-variant value (forbidden: '|' and '_')")
if key in cvs_dict:
raise click.BadParameter(f"Duplicate content-variant key '{key}'")
cvs_dict[key] = val📝 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.
| @app.command() | |
| @click.argument("url") | |
| @click.option("--cv", "cvs", multiple=True, help="Content variant like key=value (repeatable). Keys must not contain '|' or '_'") | |
| @click.option("--format", "file_format", help="Format extension (e.g. ttl)") | |
| @click.option("--compression", help="Compression (e.g. gzip)") | |
| @click.option("--sha-length", help="sha256:length (64 hex chars followed by ':' and integer length)") | |
| @click.option("--json-output", is_flag=True, help="Output JSON distribution object instead of plain string") | |
| def mkdist(url, cvs, file_format, compression, sha_length, json_output): | |
| """Create a distribution string from components.""" | |
| # Validate CVs | |
| cvs_dict = {} | |
| for cv in cvs: | |
| if "=" not in cv: | |
| raise click.BadParameter(f"Invalid content variant '{cv}': expected key=value") | |
| key, val = cv.split("=", 1) | |
| if any(ch in key for ch in ("|", "_")): | |
| raise click.BadParameter("Invalid characters in content-variant key (forbidden: '|' and '_')") | |
| if key in cvs_dict: | |
| raise click.BadParameter(f"Duplicate content-variant key '{key}'") | |
| cvs_dict[key] = val | |
| # Validate sha-length | |
| sha_tuple = None | |
| if sha_length: | |
| if not re.match(r'^[A-Fa-f0-9]{64}:\d+$', sha_length): | |
| raise click.BadParameter("Invalid --sha-length; expected SHA256HEX:length") | |
| sha, length = sha_length.split(":", 1) | |
| sha_tuple = (sha, int(length)) | |
| # Deterministic ordering | |
| sorted_cvs = {k: cvs_dict[k] for k in sorted(cvs_dict)} | |
| dist = api_deploy.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})) | |
| else: | |
| click.echo(dist) | |
| @app.command() | |
| @click.argument("url") | |
| @click.option("--cv", "cvs", multiple=True, help="Content variant like key=value (repeatable). Keys must not contain '|' or '_'") | |
| @click.option("--format", "file_format", help="Format extension (e.g. ttl)") | |
| @click.option("--compression", help="Compression (e.g. gzip)") | |
| @click.option("--sha-length", help="sha256:length (64 hex chars followed by ':' and integer length)") | |
| @click.option("--json-output", is_flag=True, help="Output JSON distribution object instead of plain string") | |
| def mkdist(url, cvs, file_format, compression, sha_length, json_output): | |
| """Create a distribution string from components.""" | |
| # Validate CVs | |
| cvs_dict = {} | |
| for cv in cvs: | |
| if "=" not in cv: | |
| raise click.BadParameter(f"Invalid content variant '{cv}': expected key=value") | |
| key, val = cv.split("=", 1) | |
| if any(ch in key for ch in ("|", "_")): | |
| raise click.BadParameter("Invalid characters in content-variant key (forbidden: '|' and '_')") | |
| if any(ch in val for ch in ("|", "_")): | |
| raise click.BadParameter("Invalid characters in content-variant value (forbidden: '|' and '_')") | |
| if key in cvs_dict: | |
| raise click.BadParameter(f"Duplicate content-variant key '{key}'") | |
| cvs_dict[key] = val | |
| # Validate sha-length | |
| sha_tuple = None | |
| if sha_length: | |
| if not re.match(r'^[A-Fa-f0-9]{64}:\d+$', sha_length): | |
| raise click.BadParameter("Invalid --sha-length; expected SHA256HEX:length") | |
| sha, length = sha_length.split(":", 1) | |
| sha_tuple = (sha, int(length)) | |
| # Deterministic ordering | |
| sorted_cvs = {k: cvs_dict[k] for k in sorted(cvs_dict)} | |
| dist = api_deploy.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})) | |
| else: | |
| click.echo(dist) |
🤖 Prompt for AI Agents
In databusclient/cli.py around lines 217 to 254, the current validation forbids
'|' and '_' only in content-variant keys but not in values, which can break the
distribution string format; add the same checks for the cv value after splitting
(forbid '|' and '_' in val) and raise click.BadParameter with a clear message
(e.g. "Invalid characters in content-variant value (forbidden: '|' and '_')") so
values containing those separators are rejected before building the
distribution.
| ### Download command | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Complete the code block or remove the incomplete heading.
Line 66 contains a heading "### Download command" followed by an incomplete code fence. Either complete this section with the intended content or remove it if it was added in error.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
67-67: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In README.md around lines 66 to 67, the heading "### Download command" is
followed by an incomplete code fence; complete the markdown by either adding the
intended download command(s) inside a properly closed code block (triple
backticks) and any explanatory text, or remove the heading and the stray
backtick if this section was added by mistake so the file has no unterminated
code fence.
| <<<<<<< HEAD | ||
|
|
||
| ``` | ||
| #### Examples of using deploy command | ||
| ##### Mode 1: Classic Deploy (Distributions) | ||
| ``` | ||
| databusclient deploy --versionid https://databus.dbpedia.org/user1/group1/artifact1/2022-05-18 --title title1 --abstract abstract1 --description description1 --license http://dalicc.net/licenselibrary/AdaptivePublicLicense10 --apikey MYSTERIOUS 'https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml|type=swagger' | ||
| ``` | ||
| ``` | ||
| databusclient deploy --versionid https://dev.databus.dbpedia.org/denis/group1/artifact1/2022-05-18 --title "Client Testing" --abstract "Testing the client...." --description "Testing the client...." --license http://dalicc.net/licenselibrary/AdaptivePublicLicense10 --apikey MYSTERIOUS 'https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml|type=swagger' | ||
| ======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve merge conflicts before merging.
The README contains unresolved merge conflict markers at multiple locations (lines 316-327, 368-389, and 419-444). These must be resolved to ensure the documentation is consistent and complete.
Also applies to: 368-389, 419-444
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
321-321: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
325-325: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In README.md around lines 316-327 (also review and fix the similar markers at
368-389 and 419-444), there are unresolved Git conflict markers (<<<<<<<,
=======, >>>>>>>) left in the file; remove the conflict markers, decide which of
the conflicting blocks to keep (or merge their contents manually into a single
correct example), ensure the surrounding Markdown is valid (code fences,
headings, and example commands are coherent), then save and commit the resolved
file.
Adds a new mkdist CLI subcommand to build validated distribution strings (enforces key=value CVs, deterministic ordering, and sha-length format) and a completion helper to print shell completion snippets. Includes unit tests and README examples.
Files changed
cli.py
test_cli.py
README.md
Quick test instructions
Run unit tests:
python -m pytest databus-python-client/tests/test_cli.py → 4 passed
python -m databusclient mkdist "https://example.org/file" --cv b=2 --cv a=1 --format ttl --compression gz --sha-length a...a:42
expected: https://example.org/file|a=1_b=2|ttl|gz|a...a:42
Notes
Validation: --cv must be key=value (no | or _ in key).
--sha-length must match ^[A-Fa-f0-9]{64}:\d+$.
Merge after CI passes. ✅
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Tests
Updates
✏️ Tip: You can customize this high-level summary in your review settings.