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

path unescape url when resolving remote reference #142

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

zak905
Copy link
Contributor

@zak905 zak905 commented Jul 18, 2023

closes #141

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d17ae1d) 99.79% compared to head (8c0bdb3) 99.79%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #142   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files         146      146           
  Lines       10349    10373   +24     
=======================================
+ Hits        10328    10352   +24     
  Misses         21       21           
Flag Coverage Δ
unittests 99.79% <100.00%> (+<0.01%) ⬆️

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

Files Changed Coverage Δ
index/find_component.go 99.56% <100.00%> (+0.01%) ⬆️

... and 4 files with indirect coverage changes

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

Copy link
Member

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is a nice upgrade.

Please add a couple of small tests to ensure the negative is handled correctly.

Thank you for your contribution.

@@ -189,6 +189,11 @@ func (index *SpecIndex) lookupRemoteReference(ref string) (*yaml.Node, *yaml.Nod
} else {
query = "$"
}

query, err := url.PathUnescape(query)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice upgrade!

My only comment is that this branch will drop code coverage without a test to check for the invalid case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you. Sure I am going to add some testing

@@ -284,6 +289,11 @@ func (index *SpecIndex) lookupFileReference(ref string) (*yaml.Node, *yaml.Node,
query = "$"
}

query, err := url.PathUnescape(query)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above about the coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allright

@daveshanley
Copy link
Member

Did you decide to stop working on this?

@zak905 zak905 deleted the main branch July 20, 2023 10:12
@zak905
Copy link
Contributor Author

zak905 commented Jul 20, 2023

Hi, Sorry something went wrong when I force pushed. Github automatically closed this when it saw that the main branch has no additional commits compared to the upstream main branch. Working on it.

@zak905 zak905 reopened this Jul 20, 2023
@zak905 zak905 requested a review from daveshanley July 20, 2023 10:17
@zak905
Copy link
Contributor Author

zak905 commented Jul 21, 2023

@daveshanley FYI, I have added some unit tests.

@zak905
Copy link
Contributor Author

zak905 commented Jul 21, 2023

Thanks, it seems like codecove server is encoutring some issues:

The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.<

Would you mind relaunching the build please ?

@daveshanley
Copy link
Member

I re-ran the build, there is just one single line missing from the coverage (that's causing it to be red)

https://app.codecov.io/gh/pb33f/libopenapi/pull/142/blob/index/find_component.go#L294

@zak905
Copy link
Contributor Author

zak905 commented Jul 24, 2023

thanks. I added an additional test to cover the missing line

@daveshanley daveshanley merged commit f7a6c9d into pb33f:main Jul 28, 2023
3 checks passed
@zak905
Copy link
Contributor Author

zak905 commented Jul 28, 2023

thanks @daveshanley

@zak905
Copy link
Contributor Author

zak905 commented Jul 29, 2023

@daveshanley, are you planning on creating a tag/release for this patch ?

@daveshanley
Copy link
Member

It was released in v0.9.7

@zak905
Copy link
Contributor Author

zak905 commented Aug 1, 2023

great thanks!

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.

Remote references: some urls may have encoded characters.
2 participants