Skip to content

Commit a39446d

Browse files
authored
Merge pull request #65 from unity-sds/develop
fix: l1A granule id is `<collection-id>___<collection-version>:<granule-id>` not to duplicate re-runs
2 parents 96a9434 + e744311 commit a39446d

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.6.17] - 2022-07-28
9+
### Added
10+
### Fixed
11+
- l1A granule id is `<collection-id>___<collection-version>:<granule-id>` not to duplicate re-runs
12+
813
## [1.6.16] - 2022-07-25
914
### Added
1015
- Added: use username & password to login to cognito to get the token

cumulus_lambda_functions/cumulus_upload_granules/upload_granules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __sort_granules(self):
8282
def __upload_granules(self, granule_assets: dict, granule_id: str):
8383
for data_type, href_dict in granule_assets.items():
8484
LOGGER.debug(f'uploading {href_dict}')
85-
s3_url = self.__s3.upload(href_dict['href'], self.__staging_bucket, granule_id, self.__delete_files)
85+
s3_url = self.__s3.upload(href_dict['href'], self.__staging_bucket, f'{self.__collection_id}:{granule_id}', self.__delete_files)
8686
href_dict['href'] = s3_url
8787
return self
8888

@@ -108,7 +108,7 @@ def start(self):
108108
for granule_id, granule_hrefs in on_disk_granules.items():
109109
self.__upload_granules(granule_hrefs, granule_id)
110110
dapa_body_granules.append({
111-
'id': granule_id,
111+
'id': f'{self.__collection_id}:{granule_id}',
112112
'collection': self.__collection_id,
113113
'assets': granule_hrefs,
114114
})

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
setup(
1818
name="cumulus_lambda_functions",
19-
version="1.6.16",
19+
version="1.6.17",
2020
packages=find_packages(),
2121
install_requires=install_requires,
2222
tests_require=['mock', 'nose', 'sphinx', 'sphinx_rtd_theme', 'coverage'],

tests/cumulus_lambda_functions/cumulus_upload_granules/upload_granules.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import os
22

33

4-
os.environ['DAPA_API'] = 'https://k3a3qmarxh.execute-api.us-west-2.amazonaws.com/dev/am-uds-dapa'
5-
os.environ['UNITY_BEARER_TOKEN'] = 'abcd.abcd.abcd-abcd-abcd'
6-
os.environ['COLLECTION_ID'] = 'SNDR_SNPP_ATMS_L1A___1'
4+
os.environ['DAPA_API'] = 'https://k3a3qmarxh.execute-api.us-west-2.amazonaws.com/dev'
5+
os.environ['USERNAME'] = '/unity/uds/user/wphyo/username'
6+
os.environ['PASSWORD'] = '/unity/uds/user/wphyo/dwssap'
7+
os.environ['PASSWORD_TYPE'] = 'PARAM_STORE'
8+
os.environ['CLIENT_ID'] = '7a1fglm2d54eoggj13lccivp25'
9+
os.environ['COGNITO_URL'] = 'https://cognito-idp.us-west-2.amazonaws.com'
10+
11+
os.environ['COLLECTION_ID'] = 'SNDR_SNPP_ATMS_L1A_NGA___1'
712
os.environ['PROVIDER_ID'] = 'SNPP'
813
os.environ['UPLOAD_DIR'] = '/tmp/snpp_upload_test_1'
914
os.environ['STAGING_BUCKET'] = 'am-uds-dev-cumulus-staging'

0 commit comments

Comments
 (0)