Fixing bug in retrieving archived workflows from Google Cloud Store (#9329)

## What changed?
Fixed a bug in the gcloud visibility_archiver.go file and added a new
unit test in visibility_archiver_test.go.

## Why?
There is a bug in the visibility-archiver implementation of the Google
Cloud archiver. All archived workflows are being retrieved and displayed
twice. This change fixes that bug.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [ ] covered by existing tests
- [X] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
No risk since the archiver is completely decoupled from the core
functionality.
This commit is contained in:
Ulrich Romahn
2026-03-04 20:50:13 -08:00
committed by GitHub
parent f9529d0481
commit 45617a882c
4 changed files with 10 additions and 4 deletions

5
.gitignore vendored
View File

@@ -43,4 +43,7 @@
/proto.tmp
**/.venv/
**/.ruff_cache/
**/.ruff_cache/
# Ignoring AI agent files
.agents/

View File

@@ -650,6 +650,9 @@ start: start-sqlite
start-cass-es: temporal-server
./temporal-server --config-file config/development-cass-es.yaml --allow-no-auth start
start-cass-archival: temporal-server
./temporal-server --config-file config/development-cass-archival.yaml --allow-no-auth start
start-cass-es-dual: temporal-server
./temporal-server --config-file config/development-cass-es-dual.yaml --allow-no-auth start

View File

@@ -214,7 +214,7 @@ func (v *visibilityArchiver) queryAll(
pageSize: request.PageSize,
nextPageToken: request.NextPageToken,
parsedQuery: &parsedQuery{},
}, saTypeMap, request.NamespaceID)
}, saTypeMap, constructVisibilityFilenamePrefix(request.NamespaceID, indexKeyCloseTimeout))
}
func (v *visibilityArchiver) queryPrefix(ctx context.Context, uri archiver.URI, request *queryVisibilityRequest, saTypeMap searchattribute.NameTypeMap, prefix string) (*archiver.QueryVisibilityResponse, error) {

View File

@@ -368,7 +368,7 @@ func (s *visibilityArchiverSuite) TestQuery_EmptyQuery_Pagination() {
storageWrapper.EXPECT().QueryWithFilters(
gomock.Any(),
URI,
gomock.Any(),
constructVisibilityFilenamePrefix(testNamespaceID, indexKeyCloseTimeout),
1,
0,
gomock.Any(),
@@ -381,7 +381,7 @@ func (s *visibilityArchiverSuite) TestQuery_EmptyQuery_Pagination() {
storageWrapper.EXPECT().QueryWithFilters(
gomock.Any(),
URI,
gomock.Any(),
constructVisibilityFilenamePrefix(testNamespaceID, indexKeyCloseTimeout),
1,
1,
gomock.Any(),