nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: maragudk/gomponents
Pull request #249 (2025-03-19 00:19:53)

add Scope attribute helper
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#scope

markuswustenberg: Thanks! 😊
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/maragudk/gomponents/pull/249?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=maragudk) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 100.00%. Comparing base [(`033f6ac`)](https://app.codecov.io/gh/maragudk/gomponents/commit/033f6ac3c36da0e95882d2e00b8cdd54468d3050?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=maragudk) to head [(`cae2a1e`)](https://app.codecov.io/gh/maragudk/gomponents/commit/cae2a1e968fe188bc0a6f100a40b905c5e1d1255?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=maragudk).
> Report is 40 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##              main      #249   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         5    -4     
  Lines          534       550   +16     
=========================================
+ Hits           534       550   +16     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/maragudk/gomponents/pull/249?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=maragudk).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=maragudk).

<details><summary>🚀 New features to boost your workflow: </summary>

- ❄ [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index fb2748b..e9a0b6d 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -277,6 +277,10 @@ func RowSpan(v string) g.Node {
 	return g.Attr("rowspan", v)
 }
 
+func Scope(v string) g.Node {
+	return g.Attr("scope", v)
+}
+
 func Src(v string) g.Node {
 	return g.Attr("src", v)
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 88185b1..6a01e03 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -93,6 +93,7 @@ func TestSimpleAttributes(t *testing.T) {
 		{Name: "role", Func: Role},
 		{Name: "rows", Func: Rows},
 		{Name: "rowspan", Func: RowSpan},
+		{Name: "scope", Func: Scope},
 		{Name: "slot", Func: SlotAttr},
 		{Name: "src", Func: Src},
 		{Name: "srcset", Func: SrcSet},
Repository: maragudk/gomponents
Pull request #257 (2025-05-14 23:08:19)

Add "search" HTML element
Hey there,

Thanks for this project! Super cool idea and I've been exploring using it to replace the standard `html/template` package in one of my Go projects.

One thing I noticed, however, is that the [search element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/search) appears to be missing. This PR adds it (and updates the tests, as well).

Please let me know if I've missed anything or if any changes should be made.

Thanks again!

markuswustenberg: Hi @theandrew168, thank you for the kind words and your contribution!

I hadn't heard of the search element before. This project really keeps me up-to-date with the HTML spec. 😁

Patch:
diff --git a/html/elements.go b/html/elements.go
index bf747a1..ecc629a 100644
--- a/html/elements.go
+++ b/html/elements.go
@@ -256,6 +256,10 @@ func Script(children ...g.Node) g.Node {
 	return g.El("script", children...)
 }
 
+func Search(children ...g.Node) g.Node {
+	return g.El("search", children...)
+}
+
 func Section(children ...g.Node) g.Node {
 	return g.El("section", children...)
 }


Test patch:
diff --git a/html/elements_test.go b/html/elements_test.go
index 7670af5..1532f71 100644
--- a/html/elements_test.go
+++ b/html/elements_test.go
@@ -102,6 +102,7 @@ func TestSimpleElements(t *testing.T) {
 		{Name: "s", Func: S},
 		{Name: "samp", Func: Samp},
 		{Name: "script", Func: Script},
+		{Name: "search", Func: Search},
 		{Name: "section", Func: Section},
 		{Name: "select", Func: Select},
 		{Name: "slot", Func: SlotEl},
Repository: oauth2-proxy/oauth2-proxy
Pull request #696 (2020-07-20 20:35:58)

Preserve query when building redirect (fix for #695)
<!--- Provide a general summary of your changes in the Title above -->

## Description

Use URL.RequestURI() in GetRedirect() to preserve any query string

Note: If you cherry-pick just the unit test from this branch the UT will express the same behavior seen in https://github.com/oauth2-proxy/oauth2-proxy/issues/695

## Motivation and Context

Fixes:  https://github.com/oauth2-proxy/oauth2-proxy/issues/695

## How Has This Been Tested?

Added unit test for a request with querystring present.
Also built a new oauth2-proxy with these changes and ran it in my env. Confirmed that the redirect works as expected behind the reverse proxy (as described in the linked bug).

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [x] My change requires a change to the documentation or CHANGELOG.
- [x] I have updated the documentation/CHANGELOG accordingly.
- [ ] I have created a feature (non-master) branch for my PR.

I'm not sure if these checkbox items apply, but let me know.


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f473fcd..fa317b23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
 
 ## Changes since v6.0.0
 
+- [#696](https://github.com/oauth2-proxy/oauth2-proxy/pull/696) Preserve query when building redirect
 - [#561](https://github.com/oauth2-proxy/oauth2-proxy/pull/561) Refactor provider URLs to package level vars (@JoelSpeed)
 - [#682](https://github.com/oauth2-proxy/oauth2-proxy/pull/682) Refactor persistent session store session ticket management (@NickMeves)
 - [#688](https://github.com/oauth2-proxy/oauth2-proxy/pull/688) Refactor session loading to make use of middleware pattern (@JoelSpeed)
diff --git a/oauthproxy.go b/oauthproxy.go
index a2053ad1..64df8eb1 100644
--- a/oauthproxy.go
+++ b/oauthproxy.go
@@ -454,7 +454,8 @@ func (p *OAuthProxy) GetRedirect(req *http.Request) (redirect string, err error)
 		redirect = req.Form.Get("rd")
 	}
 	if !p.IsValidRedirect(redirect) {
-		redirect = req.URL.Path
+		// Use RequestURI to preserve ?query
+		redirect = req.URL.RequestURI()
 		if strings.HasPrefix(redirect, p.ProxyPrefix) {
 			redirect = "/"
 		}


Test patch:
diff --git a/oauthproxy_test.go b/oauthproxy_test.go
index cb14c717..83425274 100644
--- a/oauthproxy_test.go
+++ b/oauthproxy_test.go
@@ -1678,6 +1678,11 @@ func TestGetRedirect(t *testing.T) {
 			url:              "/foo/bar",
 			expectedRedirect: "/foo/bar",
 		},
+		{
+			name:             "request with query preserves query",
+			url:              "/foo?bar",
+			expectedRedirect: "/foo?bar",
+		},
 		{
 			name:             "request under ProxyPrefix redirects to root",
 			url:              proxy.ProxyPrefix + "/foo/bar",