Skip to content

feat: add custom field clean method#62

Open
mehanizm wants to merge 4 commits into
adlio:mainfrom
mehanizm:addCustomFieldCleanMethod
Open

feat: add custom field clean method#62
mehanizm wants to merge 4 commits into
adlio:mainfrom
mehanizm:addCustomFieldCleanMethod

Conversation

@mehanizm

@mehanizm mehanizm commented Apr 7, 2020

Copy link
Copy Markdown
Contributor

This PR has three commits that need the review.

feat: add RemoveIDCustomField method

In this commit I've added the method to delete (only clear) custom field of the card by its ID (see "Clearing CustomFieldItems" here).

But there was a problem. Because of the definition of the Value field in the CustomFieldItem result from the API was not parsed correctly.
I'd tried to understand why we need here (in general purpose library) so complex unmarshaling with some kind of the business logic and stuck with that. There are no tests to explain this.

impr: change custom fields value struct

To develop this idea I've simplified CustomFieldItem struct and all corresponding methods. No tests was broken after that, only type actualization.

impr: refactor CustomFields method

As a result I've refactor CustomFields card method to use more idiomatic go code and new simplified CustomFieldItem struct.

Conclusion

I think, that it is more correct style for the general library and type casting from the CustomFieldItemValue should be done in the business logic on the application level. The casting logic that was here earlier is hard to understand and did not have general application.

mehanizm added 3 commits April 6, 2020 18:51
To unmarshal json correctly change
the custom fields struct.

See TestRemoveIDCustomField for marshalling
details.
Rewrite CustomFields method to use more
idiomatic go style code.
Use new version of the CustomFieldValue struct.

Test actualization.
@mehanizm mehanizm changed the title Add custom field clean method feat: add custom field clean method Apr 7, 2020
@codecov-io

codecov-io commented Apr 10, 2020

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.88%. Comparing base (bc8f627) to head (f731393).
⚠️ Report is 77 commits behind head on main.

Files with missing lines Patch % Lines
card.go 82.50% 4 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
+ Coverage   73.25%   77.88%   +4.62%     
==========================================
  Files          21       21              
  Lines         890      850      -40     
==========================================
+ Hits          652      662      +10     
+ Misses        206      156      -50     
  Partials       32       32              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants