feat(info): show driver docs URL in dbc info - #511
Open
djfrancesco wants to merge 1 commit into
Open
djfrancesco wants to merge 1 commit into
djfrancesco wants to merge 1 commit into
Conversation
Display the registry's docs_url for a driver in `dbc info` output: a "Docs:" line in plaintext (only when set) and a docs_url field in the --json payload (always present, empty when unset). Closes columnar-tech#499
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #499
Summary
dbc docsalready uses thedocs_urlfrom the registry index, butdbc infonever showed it. This PR adds it to both the plaintext and the JSON output.In plaintext, there's a new
Docs:line afterDescription:. It only shows up when the driver has a docs URL:With
--json, thedriver.infopayload gets adocs_urlfield:{"schema_version":1,"kind":"driver.info","payload":{"driver":"snowflake", ..., "description":"...","docs_url":"https://adbc-drivers.org/drivers/snowflake/","packages":[...]}}A few choices I made
I went with
Docs:as the label since it's short and matchesdbc docs. Drivers without a docs URL get no line at all, so their output doesn't change.In the JSON,
docs_urlis always there (empty string when unset). I left outomitemptyon purpose, so it behaves liketitle,licenseanddescriptionright next to it. The field is new, soschema_versionstays at 1.Easy to change any of these if you'd prefer something else.
The tests reuse the existing
test-driver-docs-urlfixture, and also check that a driver without a docs URL gets noDocs:line and an emptydocs_url.Not in this PR
dbc search -v --jsondoesn't includedocs_urleither. I can do that in a follow-up if you want it.Test plan
go test ./...passes with Go 1.26.8 (env and user levels)go vet ./...clean; changed files aregofmt-cleandbc info snowflakeanddbc info snowflake --jsonagainst the default registry show the docs URL