Skip to content

Commit

Permalink
Merge pull request juju#15997 from barrettj12/merge-3.2-3.3-20230725
Browse files Browse the repository at this point in the history
juju#15997

Merges the following patches:
- juju#15996
- juju#15988
- juju#15989
- juju#15984
- juju#15981
- juju#15951

### Conflicts
None.
  • Loading branch information
jujubot authored Jul 25, 2023
2 parents 4147527 + 707ee60 commit 3b70c38
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ jobs:
curl https://github.com/mattermost/mmctl/releases/download/v7.8.5/linux_amd64.tar -Lo mmctl.tar
tar -xvf mmctl.tar
./mmctl auth login 'https://chat.charmhub.io' --name Charmhub --access-token $MM_TOKEN
./mmctl post create Charmhub:juju-watercooler --message "$MESSAGE"
./mmctl post create Charmhub:juju-bot --message "$MESSAGE"
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
libdqlite-dev \
libsqlite3-dev \
sqlite3
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3
sudo snap install shfmt
- name: Download Dependencies
Expand Down
15 changes: 10 additions & 5 deletions scripts/try-merge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ type commitInfo struct {
}

type prInfo struct {
Number int `json:"number"`
Number int `json:"number"`
State string `json:"state"`
}

// Check if there is already an open merge containing this commit. If so,
Expand All @@ -178,18 +179,22 @@ func commitHasOpenPR(commit commitInfo) (prNumber int, ok bool) {
command: "gh",
args: []string{"pr", "list",
"--search", commit.SHA,
"--state", "open",
"--state", "all",
"--base", targetBranch,
"--json", "number",
"--json", "number,state",
},
})
handleExecuteError(ghRes)

prList := []prInfo{}
check(json.Unmarshal(ghRes.stdout, &prList))

if len(prList) > 0 {
return prList[0].Number, true
for _, pr := range prList {
// Check for merged PRs, just in case the merge PR landed while we've been
// checking for conflicts.
if pr.State == "OPEN" || pr.State == "MERGED" {
return pr.Number, true
}
}
return -1, false
}
Expand Down
4 changes: 2 additions & 2 deletions tests/suites/static_analysis/lint_go.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run_go() {
VER=$(golangci-lint --version | tr -s ' ' | cut -d ' ' -f 4 | cut -d '.' -f 1,2)
if [[ ${VER} != "1.52" ]] && [[ ${VER} != "v1.52" ]]; then
(echo >&2 -e '\nError: golangci-lint version does not match 1.52. Please upgrade/downgrade to the right version.')
if [[ ${VER} != "1.53" ]] && [[ ${VER} != "v1.53" ]]; then
(echo >&2 -e '\nError: golangci-lint version does not match 1.53. Please upgrade/downgrade to the right version.')
exit 1
fi
OUT=$(golangci-lint run -c .github/golangci-lint.config.yaml 2>&1)
Expand Down
5 changes: 2 additions & 3 deletions worker/dbaccessor/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,8 @@ func (w *dbWorker) openDatabase(namespace string) error {
// multiple times for the same namespace.
err := w.dbRunner.StartWorker(namespace, func() (worker.Worker, error) {
w.mu.RLock()
running := w.dbApp != nil
w.mu.RUnlock()
if !running {
defer w.mu.RUnlock()
if w.dbApp == nil {
// If the dbApp is nil, then we're either shutting down or
// rebinding the address. In either case, we don't want to
// start a new worker. We'll return ErrTryAgain to indicate
Expand Down

0 comments on commit 3b70c38

Please sign in to comment.