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: http filtering #415

Merged
merged 3 commits into from
Feb 8, 2024
Merged

feat: http filtering #415

merged 3 commits into from
Feb 8, 2024

Conversation

coopernetes
Copy link
Contributor

@coopernetes coopernetes commented Jan 24, 2024

Fixes #410

(Hello from Git Proxy 👋)

Copy link

netlify bot commented Jan 24, 2024

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit 3092274
🔍 Latest deploy log https://app.netlify.com/sites/endearing-brigadeiros-63f9d0/deploys/65c5486ba8402200084474c4

test/testRouteFilter.js Outdated Show resolved Hide resolved
Copy link
Member

@JamieSlome JamieSlome left a comment

Choose a reason for hiding this comment

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

I've left a couple of comments; otherwise very straight forward and solid implementation 👍 ❤️ 🍰

I love my emojis...

@JamieSlome
Copy link
Member

@coopernetes - can we resolve merge conflicts? I merged #409 which also had changes to the router in src/proxy/index.js?

Copy link
Member

@JamieSlome JamieSlome left a comment

Choose a reason for hiding this comment

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

LGTM! 🍰

Just need the merge conflict resolved and good to go!

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (e5bb34a) 56.85% compared to head (3092274) 57.15%.

Files Patch % Lines
src/proxy/routes/index.js 68.18% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #415      +/-   ##
==========================================
+ Coverage   56.85%   57.15%   +0.30%     
==========================================
  Files          39       39              
  Lines        1036     1055      +19     
==========================================
+ Hits          589      603      +14     
- Misses        447      452       +5     

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

@JamieSlome
Copy link
Member

JamieSlome commented Feb 6, 2024

Oh, Codecov how we love you so. @coopernetes - happy to bump up the coverage before we merge?

We should probably make the project level Action informational and the PR level breaking whilst we slowly bring up the coverage for the rest of the repository.

@coopernetes
Copy link
Contributor Author

Oh, Codecov how we love you so. @coopernetes - happy to bump up the coverage before we merge?

Most of the required refactoring for getting additional coverage is not something I want to do in this PR. I would essentially have to rewrite the Express middleware & routing layer to abstract it into a set of testable functions. That's probably effort better spent on changes to move us to 2.x.

We should probably make the project level Action informational and the PR level breaking whilst we slowly bring up the coverage for the rest of the repository.

Let me see what codecov makes available in their configuration. I would like to preserve the PR comment for the report even if the status check isn't blocking builds. This gives needed feedback in the PR while we improve overall coverage.

https://docs.codecov.com/docs/codecovyml-reference

@coopernetes
Copy link
Contributor Author

Looking at the details, I think we can retest this after #429 is merged. The "baseline" report is misreported against a different branch.

https://app.codecov.io/gh/finos/git-proxy/tree/bugfix%2Fci-permissions

@JamieSlome
Copy link
Member

@coopernetes - agree with your comment before last. #429 is now merged by the way 👌

@JamieSlome
Copy link
Member

@coopernetes - as long as we can keep a view of the coverage of suggested changes in the PR that is good enough for now.

@JamieSlome
Copy link
Member

Looking at Codecov, it looks like it is already achieving this. We just don't want to return a failing state to CI.

@coopernetes
Copy link
Contributor Author

Now that #442 is merged, let me rebase again and retest. @JamieSlome are you good with the latest changes? Hoping to get this merged soon.

Copy link
Member

@JamieSlome JamieSlome left a comment

Choose a reason for hiding this comment

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

LGTM @coopernetes ❤️

Would like to get an idea of the coverage percentage but happy to merge in any case. Will keep my eyes open for your re-base.

- Accept is only set for certain git actions so refactored into
  one validation function
- pass routes correctly to express (fix TypeError on startup)
- separate out the HTTP git filtering logic from the URL parsing, which
  includes stripping the GitHub repo owner/name.
@coopernetes
Copy link
Contributor Author

LGTM @coopernetes ❤️

Would like to get an idea of the coverage percentage but happy to merge in any case. Will keep my eyes open for your re-base.

codecov/project — 57.15% (+0.30%) compared to e5bb34a 😅

@coopernetes coopernetes merged commit 245f5b4 into finos:main Feb 8, 2024
12 checks passed
@coopernetes coopernetes deleted the gh410-http-filtering branch February 8, 2024 21:41
Psingle20 pushed a commit to Psingle20/git-proxy that referenced this pull request Nov 27, 2024
* feat: filter non-git HTTP requests being proxied

Fixes finos#410

* feat: refactor to one validation function

- Accept is only set for certain git actions so refactored into
  one validation function
- pass routes correctly to express (fix TypeError on startup)

* feat: separate url stripping into its own function

- separate out the HTTP git filtering logic from the URL parsing, which
  includes stripping the GitHub repo owner/name.
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.

Filter HTTP requests that are not specific to git operations
2 participants