Skip to content

Commit df3b08f

Browse files
authored
Fix bucket error from external contributors (#1232)
* Fix bucket error from external contributors * Linting issues * Linting * Disable Super linter comments
1 parent 0fb0429 commit df3b08f

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

.github/linters/.python-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local
173173
# supports qualified module names, as well as Unix pattern matching.
174174
ignored-modules=flask,
175175
flask_talisman,
176+
google.api_core.exceptions,
176177
google.auth.exceptions,
177178
google.cloud,
178179
jinja2,

.github/workflows/linter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
uses: super-linter/super-linter/slim@v8
3232
env:
3333
DEFAULT_BRANCH: main
34+
ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: false
3435
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3536
FILTER_REGEX_EXCLUDE: .*\.min\..*
3637
VALIDATE_BASH: true

.github/workflows/test-website.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- name: Lint Generated HTML
3838
uses: super-linter/super-linter/slim@v8
3939
env:
40+
ENABLE_GITHUB_PULL_REQUEST_SUMMARY_COMMENT: false
4041
FILTER_REGEX_INCLUDE: static/html/.*
4142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4243
VALIDATE_HTML: true

package-lock.json

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/dates.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import logging
33

44
from google.cloud import storage
5-
from google.auth.exceptions import DefaultCredentialsError
5+
from google.auth.exceptions import DefaultCredentialsError, RefreshError
6+
from google.api_core.exceptions import Forbidden
67

78
# Create/configure stream handler
89
sh = logging.StreamHandler()
@@ -21,7 +22,8 @@
2122
LOAD_DATES_FROM_GCS = True
2223
try:
2324
gcs = storage.Client()
24-
except DefaultCredentialsError: # pragma: no cover
25+
gcs.get_bucket(GCS_BUCKET) # pragma: no cover
26+
except (DefaultCredentialsError, RefreshError, Forbidden): # pragma: no cover
2527
logger.warning("Unable to authenticate to Google Cloud Storage.")
2628
LOAD_DATES_FROM_GCS = False
2729

0 commit comments

Comments
 (0)