Skip to content

feat: configio#59

Merged
GregoryAlbouy merged 12 commits into
mainfrom
feat/configio
Mar 28, 2023
Merged

feat: configio#59
GregoryAlbouy merged 12 commits into
mainfrom
feat/configio

Conversation

@GregoryAlbouy

@GregoryAlbouy GregoryAlbouy commented Oct 29, 2022

Copy link
Copy Markdown
Member

⚠️ DO NOT MERGE until it targets master

Description

Changes

  • Relocate configfile from benchttp/cli into this repo
  • Normalize API around Unmarshal and NewDecoder(in).Decode(&dst)
  • Refactor implementation and tests for file unmarshaling (configio.file)
  • Dedicated package documentation (go doc + readme)
    ➡️ Exhaustive documentation for package configio #65
  • Expose configio.file?
    ➡️ No use case for now
  • Static errors for decoders (same as file errors)
    ➡️ TODO: create issue for error handling
  • Rethink configio.Representation? (hardly usable besides direct unmarshaling)
    ➡️ feat(configio): implement Builder #61
  • Implement encoding functions: benchttp.Runner -> configio.Representation -> []byte (json/yaml)
    ➡️ Implement and expose config encoding functions #63

Notes

@GregoryAlbouy GregoryAlbouy added this to the v0.2 milestone Oct 29, 2022
@GregoryAlbouy GregoryAlbouy added enhancement New feature or request breaking changes Introduces breaking changes labels Oct 29, 2022
@codecov-commenter

codecov-commenter commented Oct 29, 2022

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (feat/major-api-improvements@a3b1225). Click here to learn what that means.
The diff coverage is n/a.

@@                      Coverage Diff                       @@
##             feat/major-api-improvements      #59   +/-   ##
==============================================================
  Coverage                               ?   81.64%           
==============================================================
  Files                                  ?       27           
  Lines                                  ?      899           
  Branches                               ?        0           
==============================================================
  Hits                                   ?      734           
  Misses                                 ?      137           
  Partials                               ?       28           
Flag Coverage Δ
unittests 81.64% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@GregoryAlbouy GregoryAlbouy force-pushed the feat/configio branch 2 times, most recently from 8f09a6d to 3b14230 Compare October 30, 2022 17:27
@GregoryAlbouy GregoryAlbouy marked this pull request as ready for review October 30, 2022 23:31
@GregoryAlbouy GregoryAlbouy force-pushed the feat/configio branch 4 times, most recently from f2850a8 to 5d5465f Compare November 6, 2022 12:09
@GregoryAlbouy GregoryAlbouy changed the base branch from feat/major-api-improvements to feat/benchttptest November 6, 2022 12:09
Base automatically changed from feat/benchttptest to main March 28, 2023 20:45
Rethink exposed API so it matches the native json lib.

- replace Parse -> Decode in all declarations and file names
- expose top-level unmarshaling & decoding functions:
  - UnmarshalJSON, UnmarshalYAML: unmarshal bytes into *Representation
  - UnmarshalJSONRunner, UnmarshalYAMLRunner: same into *benchttp.Runner
  - NewJSONDecoder, NewYAMLDecoder: same as json.NewDecoder
  - DecoderOf: returns appropriate Decoder given an extension
- make testdata more robust easy to reason about using a dedicated
  package
- use table testing
- use benchttptest for runner comparison
- extract assertXxx helpers
- use dedicated data structure (file)
- rethink namings
- move functions to appropriate places
@GregoryAlbouy GregoryAlbouy merged commit a729645 into main Mar 28, 2023
@GregoryAlbouy GregoryAlbouy deleted the feat/configio branch March 28, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes Introduces breaking changes enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants