Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.0.2 - attempt #2 #555

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
jobs:
call-changelog-check-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.13.2
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.14.0

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
2 changes: 1 addition & 1 deletion .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

jobs:
call-create-jira-issue-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.13.2
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.14.0
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_FIELDS: ${{ secrets.JIRA_FIELDS }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
2 changes: 1 addition & 1 deletion .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
jobs:
call-labeled-pr-check-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.13.2
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.14.0

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
2 changes: 1 addition & 1 deletion .github/workflows/release-checklist-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
call-release-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.13.2
uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.14.0
permissions:
pull-requests: write
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.13.2
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.14.0
with:
release_prefix: GRFN Ingest
release_branch: prod
develop_branch: test
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
5 changes: 4 additions & 1 deletion .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
jobs:

call-ruff-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
uses: ASFHyP3/actions/.github/workflows/[email protected]

call-mypy-workflow:
Comment on lines +8 to +10

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
uses: ASFHyP3/actions/.github/workflows/[email protected]

cfn-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
jobs:
call-bump-version-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.13.2
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.14.0
with:
user: tools-bot
email: [email protected]
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.2]
### Added
- Added `mypy` to static analysis workflow.

### Changed
- Replaced `flake8` with `ruff`.

Expand Down
4 changes: 1 addition & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: grfn-ingest
channels:
- conda-forge
- nodefaults
dependencies:
- python=3.12
- pip
- pip:
- pytest
- boto3
- pytest-mock
- -r requirements-all.txt
2 changes: 1 addition & 1 deletion ingest/src/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
log = getLogger()
log.setLevel('INFO')
s3 = boto3.resource('s3')
config = json.loads(os.getenv('CONFIG'))
config = json.loads(os.environ['CONFIG'])


def copy_s3_object(copy_source, dest_bucket, dest_key, transfer_config):
Expand Down
4 changes: 2 additions & 2 deletions invoke/src/invoke.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import json
import os
from logging import getLogger
from os import getenv

import boto3


log = getLogger()
log.setLevel('INFO')
CONFIG = json.loads(getenv('CONFIG'))
CONFIG = json.loads(os.environ['CONFIG'])

sqs = boto3.resource('sqs')
sfn = boto3.client('stepfunctions')
Expand Down
2 changes: 1 addition & 1 deletion metadata-construction/src/metadata_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

log = getLogger()
log.setLevel('INFO')
CONFIG = json.loads(os.getenv('CONFIG'))
CONFIG = json.loads(os.environ['CONFIG'])

s3 = boto3.resource('s3')

Expand Down
4 changes: 2 additions & 2 deletions metadata-to-cmr/src/daemon.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import os
from logging import getLogger
from os import getenv

import boto3
from botocore.client import Config
Expand All @@ -11,7 +11,7 @@

log = getLogger()
log.setLevel('INFO')
CONFIG = json.loads(getenv('CONFIG'))
CONFIG = json.loads(os.environ['CONFIG'])


def get_sfn_client(connect_timeout):
Expand Down
4 changes: 2 additions & 2 deletions notify/src/notify.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import json
import os
from datetime import datetime
from logging import getLogger
from os import getenv

import boto3


log = getLogger()
log.setLevel('INFO')
CONFIG = json.loads(getenv('CONFIG'))
CONFIG = json.loads(os.environ['CONFIG'])


def create_response(event, error_config):
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ convention = "google"
[tool.ruff.lint.isort]
case-sensitive = true
lines-after-imports = 2

[tool.mypy]
python_version = "3.12"
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
strict_equality = true
check_untyped_defs = true
5 changes: 5 additions & 0 deletions requirements-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
-r requirements-invoke.txt
-r requirements-notify.txt
-r requirements-verify.txt
boto3
pytest
pytest-mock
ruff
mypy
4 changes: 2 additions & 2 deletions tests/test_metadata_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_create_granule_metadata_in_s3_g1(test_data_dir, mocker):

assert metadata_construction.create_granule_metadata_in_s3(inputs, config) == metadata_s3_object

assert metadata_construction.upload_content_to_s3.mock_calls == [
assert metadata_construction.upload_content_to_s3.mock_calls == [ # type: ignore[attr-defined]
unittest.mock.call(
metadata_s3_object,
json.dumps(json.loads((test_data_dir / 'granule1' / 'granule.umm.json').read_text()), sort_keys=True),
Expand All @@ -93,7 +93,7 @@ def test_create_granule_metadata_in_s3_g2(test_data_dir, mocker):

assert metadata_construction.create_granule_metadata_in_s3(inputs, config) == metadata_s3_object

assert metadata_construction.upload_content_to_s3.mock_calls == [
assert metadata_construction.upload_content_to_s3.mock_calls == [ # type: ignore[attr-defined]
unittest.mock.call(
metadata_s3_object,
json.dumps(json.loads((test_data_dir / 'granule2' / 'granule.umm.json').read_text()), sort_keys=True),
Expand Down
Loading