feat: ci, harden changelog lint (#12483)
* feat: ci, changelog lint, harden * fix: e2e-search flakiness * fix: bleve search query
This commit is contained in:
1 parent
01f58dabcd
commit
87d1aaebdd
8 files changed
+70
-11
No files matched your search
@@ -331,13 +331,12 @@ endif
|
|||||||
.PHONY: changelog-lint
|
.PHONY: changelog-lint
|
||||||
changelog-lint:
|
changelog-lint:
|
||||||
@FAILED=0; \
|
@FAILED=0; \
|
||||||
for f in $$(git diff --name-only origin/master...HEAD -- 'changelog/*.md'); do \
|
while IFS= read -r -d '' f; do \
|
||||||
[ -f "$$f" ] || continue; \
|
|
||||||
title=$$(head -1 "$$f"); \
|
title=$$(head -1 "$$f"); \
|
||||||
if [ $${#title} -gt 80 ]; then \
|
if [ $${#title} -gt 80 ]; then \
|
||||||
echo "$$f: title is too long ($${#title} chars, max 80)"; FAILED=1; \
|
echo "$$f: title too long ($${#title}/80)"; FAILED=1; \
|
||||||
fi; \
|
fi; \
|
||||||
done; \
|
done < <(find changelog -mindepth 2 -name "*.md" -print0); \
|
||||||
exit $$FAILED
|
exit $$FAILED
|
||||||
|
|
||||||
.PHONY: changelog-csv
|
.PHONY: changelog-csv
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Enhancement: Use a default protocol parameter instead of explicitly disabling tus
|
Enhancement: Use default upload protocol instead of explicitly disabling tus
|
||||||
|
|
||||||
https://github.com/cs3org/reva/pull/1331
|
https://github.com/cs3org/reva/pull/1331
|
||||||
https://github.com/owncloud/ocis/pull/1374
|
https://github.com/owncloud/ocis/pull/1374
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Enhancement: Added `share_jail` and `projects` feature flags in spaces capability
|
Enhancement: Added share_jail and projects feature flags in spaces capability
|
||||||
|
|
||||||
We've added feature flags to the `spaces` capability to indicate to clients which features are supposed to be shown to users.
|
We've added feature flags to the `spaces` capability to indicate to clients which features are supposed to be shown to users.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Bugfix: Prevent panic in presigned URL authentication when the signing key is missing
|
Bugfix: Prevent panic in presigned URL auth when signing key is missing
|
||||||
|
|
||||||
The presigned-URL authenticator read the per-user signing key from a store and
|
The presigned-URL authenticator read the per-user signing key from a store and
|
||||||
indexed the first record without checking that the result was non-empty. When
|
indexed the first record without checking that the result was non-empty. When
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Bugfix: DELETE /graph/v1.0/education/users/{id} no longer 404s while leaving the LDAP entry behind
|
Bugfix: Education user DELETE no longer 404s while leaving LDAP entry behind
|
||||||
|
|
||||||
The education user delete handler used `user.GetExternalID()` for the backend
|
The education user delete handler used `user.GetExternalID()` for the backend
|
||||||
DELETE, while the regular `/users` handler and the pre-v8.0 code path used
|
DELETE, while the regular `/users` handler and the pre-v8.0 code path used
|
||||||
|
|||||||
@@ -115,7 +115,15 @@ func walk(offset int, nodes []ast.Node) (bleveQuery.Query, int, error) {
|
|||||||
isGroup = group
|
isGroup = group
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
q = bleveQuery.NewQueryStringQuery(k + ":" + v)
|
// Explicit name: queries use TermQuery to bypass NewQueryStringQuery's
|
||||||
|
// Unicode word-boundary splitting, which breaks non-ASCII filenames.
|
||||||
|
if n.Key != "" && k == "Name" && !strings.ContainsAny(n.Value, "*?") {
|
||||||
|
tq := bleveQuery.NewTermQuery(strings.ToLower(n.Value))
|
||||||
|
tq.SetField(k)
|
||||||
|
q = tq
|
||||||
|
} else {
|
||||||
|
q = bleveQuery.NewQueryStringQuery(k + ":" + v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if prev == nil {
|
if prev == nil {
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ import (
|
|||||||
tAssert "github.com/stretchr/testify/assert"
|
tAssert "github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func nameTermQuery(term string) *query.TermQuery {
|
||||||
|
q := query.NewTermQuery(term)
|
||||||
|
q.SetField("Name")
|
||||||
|
return q
|
||||||
|
}
|
||||||
|
|
||||||
var timeMustParse = func(t *testing.T, ts string) time.Time {
|
var timeMustParse = func(t *testing.T, ts string) time.Time {
|
||||||
tp, err := time.Parse(time.RFC3339Nano, ts)
|
tp, err := time.Parse(time.RFC3339Nano, ts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -59,8 +65,8 @@ func Test_compile(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
want: query.NewConjunctionQuery([]query.Query{
|
want: query.NewConjunctionQuery([]query.Query{
|
||||||
query.NewQueryStringQuery(`Name:john\ smith`),
|
nameTermQuery("john smith"),
|
||||||
query.NewQueryStringQuery(`Name:jane`),
|
nameTermQuery("jane"),
|
||||||
}),
|
}),
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,6 +42,42 @@ def ocis_healthy(ocis_url: str, use_basic_auth: bool = True) -> bool:
|
|||||||
return r.stdout.strip() == "200"
|
return r.stdout.strip() == "200"
|
||||||
|
|
||||||
|
|
||||||
|
def search_ready(ocis_url: str) -> bool:
|
||||||
|
# WebDAV REPORT returning 207 proves auth-basic is registered in the gateway,
|
||||||
|
# the search service is alive, and the NATS startup backlog has drained.
|
||||||
|
body = (
|
||||||
|
'<?xml version="1.0" encoding="UTF-8"?>'
|
||||||
|
'<oc:search-files xmlns:oc="http://owncloud.org/ns">'
|
||||||
|
'<oc:search><oc:pattern>warmup-probe</oc:pattern><oc:limit>1</oc:limit></oc:search>'
|
||||||
|
'</oc:search-files>'
|
||||||
|
)
|
||||||
|
cmd = [
|
||||||
|
"curl", "-sk", "-uadmin:admin",
|
||||||
|
"-X", "REPORT",
|
||||||
|
"-H", "Content-Type: application/xml",
|
||||||
|
"-d", body,
|
||||||
|
f"{ocis_url}/dav/spaces",
|
||||||
|
"-w", "%{http_code}", "-o", "/dev/null",
|
||||||
|
]
|
||||||
|
r = subprocess.run(cmd, capture_output=True, text=True)
|
||||||
|
return r.stdout.strip() == "207"
|
||||||
|
|
||||||
|
|
||||||
|
def tika_warm(tika_url: str) -> bool:
|
||||||
|
# Force a JVM extraction before tests start so cold-start latency doesn't
|
||||||
|
# delay the async upload→index pipeline past the test's poll window.
|
||||||
|
cmd = [
|
||||||
|
"curl", "-sf",
|
||||||
|
"-X", "PUT",
|
||||||
|
"-H", "Content-Type: text/plain",
|
||||||
|
"-d", "warmup",
|
||||||
|
f"{tika_url}/tika",
|
||||||
|
"-w", "%{http_code}", "-o", "/dev/null",
|
||||||
|
]
|
||||||
|
r = subprocess.run(cmd, capture_output=True, text=True)
|
||||||
|
return r.stdout.strip() == "200"
|
||||||
|
|
||||||
|
|
||||||
def run(cmd: list, env: dict = None, check: bool = True, cwd=None):
|
def run(cmd: list, env: dict = None, check: bool = True, cwd=None):
|
||||||
e = {**os.environ, **(env or {})}
|
e = {**os.environ, **(env or {})}
|
||||||
return subprocess.run(cmd, env=e, check=check, cwd=cwd)
|
return subprocess.run(cmd, env=e, check=check, cwd=cwd)
|
||||||
@@ -291,10 +327,20 @@ def main() -> int:
|
|||||||
signal.signal(signal.SIGTERM, cleanup)
|
signal.signal(signal.SIGTERM, cleanup)
|
||||||
signal.signal(signal.SIGINT, cleanup)
|
signal.signal(signal.SIGINT, cleanup)
|
||||||
|
|
||||||
|
tika_url = "http://localhost:9998"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
wait_for(lambda: ocis_healthy(ocis_url, use_basic_auth=not keycloak_needed), 300, "ocis")
|
wait_for(lambda: ocis_healthy(ocis_url, use_basic_auth=not keycloak_needed), 300, "ocis")
|
||||||
print("ocis ready.")
|
print("ocis ready.")
|
||||||
|
|
||||||
|
if tika_needed:
|
||||||
|
wait_for(lambda: tika_warm(tika_url), 60, "tika warm-up")
|
||||||
|
print("tika warm.")
|
||||||
|
|
||||||
|
if not keycloak_needed:
|
||||||
|
wait_for(lambda: search_ready(ocis_url), 60, "search service")
|
||||||
|
print("search ready.")
|
||||||
|
|
||||||
playwright_env = {
|
playwright_env = {
|
||||||
**os.environ,
|
**os.environ,
|
||||||
"BASE_URL_OCIS": ocis_url,
|
"BASE_URL_OCIS": ocis_url,
|
||||||
|
|||||||
Reference in new issue
Block a user