Skip to content

Commit

Permalink
Merge branch 'main' into tile_cond
Browse files Browse the repository at this point in the history
  • Loading branch information
jiggoha committed Jan 9, 2024
2 parents e53ecbf + 7ef7672 commit f754723
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
uses: github/codeql-action/init@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -59,7 +59,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
uses: github/codeql-action/autobuild@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -72,6 +72,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
uses: github/codeql-action/analyze@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
uses: github/codeql-action/upload-sarif@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0
with:
sarif_file: results.sarif
6 changes: 5 additions & 1 deletion experimental/gcp-log/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ func Integrate(w http.ResponseWriter, r *http.Request) {
http.Error(w,
fmt.Sprintf("Failed to read log checkpoint: %q", err),
http.StatusInternalServerError)
return
}

// Check signatures
Expand All @@ -319,6 +320,7 @@ func Integrate(w http.ResponseWriter, r *http.Request) {
http.Error(w,
fmt.Sprintf("Failed to open Checkpoint: %q", err),
http.StatusInternalServerError)
return
}

// Integrate new entries
Expand All @@ -330,14 +332,16 @@ func Integrate(w http.ResponseWriter, r *http.Request) {
return
}
if newCp == nil {
http.Error(w, "Nothing to integrate", http.StatusInternalServerError)
http.Error(w, "Nothing to integrate", http.StatusBadRequest)
return
}

err = signAndWrite(ctx, newCp, cpNote, noteSigner, client, d.Origin)
if err != nil {
http.Error(w,
fmt.Sprintf("Failed to sign: %q", err),
http.StatusInternalServerError)
return
}

return
Expand Down
8 changes: 6 additions & 2 deletions experimental/gcp-log/internal/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ func (c *Client) SetNextSeq(num uint64) {
}

// WriteCheckpoint stores a raw log checkpoint on GCS if it matches the
// generation that the client thinks the checkpoint is.
// generation that the client thinks the checkpoint is. The client updates the
// generation number of the checkpoint whenever ReadCheckpoint is called.
//
// This method will fail to write if 1) the checkpoint exists and the client
// has never read it or 2) the checkpoint has been updated since the client
// called ReadCheckpoint.
func (c *Client) WriteCheckpoint(ctx context.Context, newCPRaw []byte) error {
bkt := c.gcsClient.Bucket(c.bucket)
obj := bkt.Object(layout.CheckpointPath)
Expand All @@ -161,7 +166,6 @@ func (c *Client) WriteCheckpoint(ctx context.Context, newCPRaw []byte) error {
if _, err := w.Write(newCPRaw); err != nil {
return err
}
c.checkpointGen++
return w.Close()
}

Expand Down

0 comments on commit f754723

Please sign in to comment.