Skip to content
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

feat: support Konnect document objects #388

Merged
merged 1 commit into from
May 17, 2021
Merged

Conversation

rainest
Copy link
Contributor

@rainest rainest commented May 17, 2021

Squashed version of the commits currently in feat/konnect-documents. Previous discussion was in #336 and #358.

- Add support for Documents in Konnect commands.

  Documents are informational content associated with Service Versions
  and Service Packages. DecK stores metadata about them in konnect.yaml
  and their text content separately in files that live in the same
  directory as konnect.yaml. The konnect.yaml document metadata includes
  a "path" field that indicates the relative filepath for the document's
  content. DecK also sets the "path" value of document objects in the
  Konnect API to the base of the the filepath stored in the document
  metadata.

  dumps construct filepaths for new documents using directories for the
  Service Package and/or Service Version attached to the document. For
  example, content for a document, "swagger.json" attached to version
  1.2.3 of package "foobar" will be stored at
  "foobar/1.2.3/swagger.json".

  Because the standard decK diff display would be quite verbose for many
  documents, diff output for documents instead uses a unified diff to
  display only changed content with minimal context.

- Add a ParentInfoer interface implemented by the ServicePackage and
  ServiceVersion types. Types without independent API endpoints (e.g.
  Document) can include a ParentInfoer reference and use it to retrieve
  their parent object's URL.

- Disable stdout mode for Konnect commands. The separate content file
  model used by documents is not compatible with sending all decK output
  to stdout.
@rainest rainest requested a review from a team as a code owner May 17, 2021 21:09
@codecov-commenter
Copy link

Codecov Report

Merging #388 (9fa28fd) into main (829116a) will decrease coverage by 6.61%.
The diff coverage is 34.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
- Coverage   53.59%   46.97%   -6.62%     
==========================================
  Files          62       87      +25     
  Lines        5034     6009     +975     
==========================================
+ Hits         2698     2823     +125     
- Misses       2037     2863     +826     
- Partials      299      323      +24     
Impacted Files Coverage Δ
cmd/common_konnect.go 14.58% <0.00%> (-0.64%) ⬇️
dump/dump_konnect.go 26.96% <0.00%> (-6.37%) ⬇️
file/konnect.go 0.00% <0.00%> (ø)
file/types.go 70.24% <ø> (ø)
file/writer.go 13.55% <0.00%> (-1.61%) ⬇️
solver/document.go 0.00% <0.00%> (ø)
solver/solver.go 0.00% <0.00%> (ø)
state/builder.go 0.00% <0.00%> (ø)
utils/types.go 22.05% <ø> (ø)
state/konnect_types.go 15.90% <6.66%> (-4.79%) ⬇️
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 829116a...9fa28fd. Read the comment docs.

@rainest rainest merged commit 71c5e46 into main May 17, 2021
@rainest rainest deleted the merge/konnect-documents branch May 17, 2021 21:40
AntoineJac pushed a commit that referenced this pull request Jan 23, 2024
- Add support for Documents in Konnect commands.

  Documents are informational content associated with Service Versions
  and Service Packages. DecK stores metadata about them in konnect.yaml
  and their text content separately in files that live in the same
  directory as konnect.yaml. The konnect.yaml document metadata includes
  a "path" field that indicates the relative filepath for the document's
  content. DecK also sets the "path" value of document objects in the
  Konnect API to the base of the the filepath stored in the document
  metadata.

  dumps construct filepaths for new documents using directories for the
  Service Package and/or Service Version attached to the document. For
  example, content for a document, "swagger.json" attached to version
  1.2.3 of package "foobar" will be stored at
  "foobar/1.2.3/swagger.json".

  Because the standard decK diff display would be quite verbose for many
  documents, diff output for documents instead uses a unified diff to
  display only changed content with minimal context.

- Add a ParentInfoer interface implemented by the ServicePackage and
  ServiceVersion types. Types without independent API endpoints (e.g.
  Document) can include a ParentInfoer reference and use it to retrieve
  their parent object's URL.

- Disable stdout mode for Konnect commands. The separate content file
  model used by documents is not compatible with sending all decK output
  to stdout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants