Skip to content

Commit 1b20edf

Browse files
authored
Merge pull request #367 from fairdataihub/pre-staging
feat: 15.2.2 release
2 parents 1c40d13 + a191694 commit 1b20edf

File tree

20 files changed

+235
-39
lines changed

20 files changed

+235
-39
lines changed

.github/workflows/Build-and-deploy-linux.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- main
88
- staging
99
- pre-staging
10-
- empty-folders-files-hotfix
1110

1211
jobs:
1312
deploy-on-linux:

.github/workflows/Build-and-deploy-mac.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- main
88
- staging
99
- pre-staging
10-
- empty-folders-files-hotfix
1110

1211
jobs:
1312
deploy-on-mac:

.github/workflows/Build-and-deploy-win.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- main
88
- staging
99
- pre-staging
10-
- empty-folders-files-hotfix
1110

1211
jobs:
1312
deploy-on-windows:

CHANGELOG.md

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

8+
## v15.2.2 - 2024-10-09
9+
10+
## Bug Fixes:
11+
12+
- Fixed an issue with the Pennsieve agent version check not being able to detect old versions of the Pennsieve agent (The agent found at https://github.com/Pennsieve/agent).
13+
- Fixed an issue in how SODA reads the config.ini file that made it so that if the account name 'SODA-Pennsieve' exists it is always used for authentication with Pennsieve even when a defualt_profile key exists in the config.
14+
- Fixed an issue in the manifest creation and banner image upload/edit features of the `Advanced Features` tab that made it so users without Pennsieve Agents were not directed to the Pennsieve Agent download page. Instead they were told 'the pennsieve agent is not running.'
15+
- It was possible for an upload to fail early in 'Prepare Datasets Step-by-Step' and 'Upload Dataset' such that the catch statement referenced a variable that was not yet defined. This has been fixed.
16+
817
## v15.2.0 - 2024-08-21
918

1019
## Feature Additions:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "soda-for-sparc",
33
"procductName": "SODA for SPARC",
4-
"version": "15.2.2-beta",
4+
"version": "15.2.2",
55
"description": "Keep Calm and Curate",
66
"main": "./out/main/index.js",
77
"author": "SODA Team",

src/pyflask/configUtils/config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def lowercase_account_names(config, account_name, configpath):
5454

5555
# add the section back with the lowercase account name
5656
config.add_section(formatted_account_name)
57-
config.set(formatted_account_name, "api_token", config.get(formatted_account_name, "api_token"))
58-
config.set(formatted_account_name, "api_secret", config.get(formatted_account_name, "api_secret"))
57+
config.set(formatted_account_name, "api_token", config.get(account_name, "api_token"))
58+
config.set(formatted_account_name, "api_secret", config.get(account_name, "api_secret"))
5959

6060
# set the global default_profile option to lowercase
6161
config.set("global", "default_profile", formatted_account_name)

src/pyflask/curate/curate.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -907,10 +907,7 @@ def recursive_dataset_scan(
907907
list_copy_files, list_move_files = recursive_dataset_scan(
908908
folder, folderpath, list_copy_files, list_move_files
909909
)
910-
for file in list_copy_files:
911-
namespace_logger.info(f"file to copy: {file}")
912-
for file in list_move_files:
913-
namespace_logger.info(f"file to move: {file}")
910+
914911
# 3. Add high-level metadata files in the list
915912
if "metadata-files" in soda_json_structure.keys():
916913
namespace_logger.info("generate_dataset_locally (optional) step 3 handling metadata-files")
@@ -1900,6 +1897,11 @@ def build_create_folder_request(folder_name, folder_parent_id, dataset_id):
19001897

19011898
bytes_file_path_dict = {}
19021899

1900+
# retry variables instantiated outside function
1901+
list_of_files_to_rename = {}
1902+
renamed_files_counter = 0
1903+
1904+
19031905
def ps_upload_to_dataset(soda_json_structure, ps, ds, resume=False):
19041906
global namespace_logger
19051907

@@ -1925,7 +1927,9 @@ def ps_upload_to_dataset(soda_json_structure, ps, ds, resume=False):
19251927
global elapsed_time
19261928
global manifest_id
19271929
global origin_manifest_id
1928-
global main_curate_status
1930+
global main_curate_status
1931+
global list_of_files_to_rename
1932+
global renamed_files_counter
19291933

19301934

19311935
total_files = 0

src/pyflask/datasets/compare_local_remote_files.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
def import_subfolders(subfolder, path):
1818
global PENNSIEVE_URL
19+
global namespace_logger
1920
global pennsieve_dataset_paths
2021
folder_id = subfolder["id"]
2122
try:
@@ -38,7 +39,7 @@ def import_subfolders(subfolder, path):
3839
for folder_name, folder in subfolder["folders"].items():
3940
import_subfolders(folder, f"{path}/{folder_name}")
4041
except Exception as e:
41-
print(f"Exception when calling API: {e}")
42+
namespace_logger.info(f"Exception when calling API: {e}")
4243
raise e
4344

4445

@@ -72,7 +73,7 @@ def import_pennsieve_dataset(dataset_id, path):
7273
for folder_name, folder in pennsieve_dataset_structure["folders"].items():
7374
import_subfolders(folder, f"{folder_name}")
7475
except Exception as e:
75-
print(f"Exception when calling API: {e}")
76+
namespace_logger.info(f"Exception when calling API: {e}")
7677
raise e
7778

7879

@@ -100,7 +101,7 @@ def import_local_dataset(path):
100101
for folder_name, folder in local_dataset_structure["folders"].items():
101102
import_local_subfolders(folder, f"{path}/{folder_name}")
102103
except Exception as e:
103-
print(f"Exception when calling API: {e}")
104+
namespace_logger.info(f"Exception when calling API: {e}")
104105
raise e
105106

106107

@@ -125,7 +126,7 @@ def import_local_subfolders(subfolder, path):
125126
for folder_name, folder in subfolder["folders"].items():
126127
import_local_subfolders(folder, f"{path}/{folder_name}")
127128
except Exception as e:
128-
print(f"Exception when calling API: {e}")
129+
namespace_logger.info(f"Exception when calling API: {e}")
129130
raise e
130131

131132

src/pyflask/datasets/datasets.py

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def reserve_dataset_doi(dataset): # sourcery skip: extract-method
132132
doi_request.raise_for_status()
133133
return {"doi": doi_request.json()["doi"]}
134134
except Exception as e:
135-
print(e)
136135
abort(e.response.status_code, e.response.json().get('message'))
137136

138137

src/pyflask/manageDatasets/manage_datasets.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,7 @@ def bf_get_accounts():
265265
sections = config.sections()
266266
global namespace_logger
267267

268-
if SODA_SPARC_API_KEY in sections:
269-
lowercase_account_names(config, SODA_SPARC_API_KEY, configpath)
270-
with contextlib.suppress(Exception):
271-
get_access_token()
272-
return SODA_SPARC_API_KEY.lower()
273-
elif "global" in sections:
268+
if "global" in sections:
274269
if "default_profile" in config["global"]:
275270
default_profile = config["global"]["default_profile"]
276271
if default_profile in sections:
@@ -282,6 +277,13 @@ def bf_get_accounts():
282277
except Exception as e:
283278
namespace_logger.info("Failed to authenticate the stored token")
284279
abort(401, e)
280+
281+
elif SODA_SPARC_API_KEY in sections:
282+
lowercase_account_names(config, SODA_SPARC_API_KEY, configpath)
283+
with contextlib.suppress(Exception):
284+
get_access_token()
285+
return SODA_SPARC_API_KEY.lower()
286+
285287
else:
286288
namespace_logger.info("No default account found")
287289
for account in sections:

src/pyflask/startup/minimumApiVersion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ def get_api_version():
99

1010

1111

12-
return {'version': os.getenv('API_VERSION', "15.2.2-beta")}
12+
return {'version': os.getenv('API_VERSION', "15.2.2")}
1313

1414

src/renderer/src/assets/component-utils/addDatasetAndOrganizationCards.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const addDatasetAndOrganizationCardComponents = () => {
165165
currentParentTab: "add_edit_banner_parent-tab",
166166
action: "delete",
167167
section: "individual-question manage-dataset",
168-
dataNext: "div_add_edit_banner",
168+
dataNext: "div_add_edit_banner_image_agent_check",
169169
fields: [
170170
FIELD_OPTIONS.ACCOUNT_EDITABLE,
171171

src/renderer/src/components/backgroundServices/PennsieveAgentCheckDisplay/index.jsx

+31-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const CLOSE_SODA_BUTTON_TEXT = "Close SODA";
1111
const KNOWN_ERROR_MESSAGES = [
1212
"UNIQUE constraint failed:",
1313
"NotAuthorizedException: Incorrect username or password.",
14-
"401 Error Creating new UserSettings",
14+
"UserSettings" /* If the error message contains "UserSettings", it is likely solved by deleting the Pennsieve Agent database files */,
1515
];
1616

1717
// Utility Functions
@@ -22,13 +22,24 @@ const deletePennsieveAgentDBFilesAndRestart = async () => {
2222
"/.pennsieve/pennsieve_agent.db-wal",
2323
];
2424

25-
for (const file of filesToDelete) {
26-
const filePath = `${window.homeDirectory}${file}`;
27-
if (window.fs.existsSync(filePath)) {
28-
await window.fs.unlink(filePath);
25+
try {
26+
// Stop the Pennsieve agent to free up the database files
27+
await window.spawn.stopPennsieveAgent();
28+
29+
// Delete the Pennsieve agent database files
30+
for (const file of filesToDelete) {
31+
const filePath = `${window.homeDirectory}${file}`;
32+
if (window.fs.existsSync(filePath)) {
33+
await window.fs.unlink(filePath);
34+
} else {
35+
console.error(`Unable to find Pennsieve agent DB file: ${filePath}`);
36+
}
2937
}
38+
} catch (error) {
39+
console.error("Error deleting Pennsieve agent DB files:", error);
3040
}
3141

42+
// Restart the Pennsieve agent check
3243
await window.checkPennsieveAgent();
3344
};
3445

@@ -61,8 +72,14 @@ const PennsieveAgentErrorMessageDisplay = ({ errorMessage }) => {
6172
<>
6273
<Text>
6374
This is a known issue with the Pennsieve Agent. It can typically be resolved by
64-
deleting the local Pennsieve Agent database files. Would you like SODA to do this
65-
and restart the Agent?
75+
deleting the local Pennsieve Agent database files. You can refer to the
76+
<ExternalLink
77+
href="https://docs.sodaforsparc.io/docs/common-errors/trouble-starting-the-pennsieve-agent-in-soda"
78+
buttonText="SODA documentation"
79+
buttonType="anchor"
80+
/>
81+
for information on how to fix the issue manually. SODA can also attempt to fix the
82+
issue for you. Would you like to have SODA try to fix the issue?
6683
</Text>
6784
<Group justify="center" mt="sm">
6885
<Button onClick={deletePennsieveAgentDBFilesAndRestart}>
@@ -108,6 +125,7 @@ const PennsieveAgentCheckDisplay = () => {
108125
postPennsieveAgentCheckAction,
109126
} = useGlobalStore();
110127

128+
// If the Pennsieve agent check is in progress, display a loading spinner
111129
if (pennsieveAgentCheckInProgress === true) {
112130
return (
113131
<FullWidthContainer>
@@ -121,6 +139,7 @@ const PennsieveAgentCheckDisplay = () => {
121139
);
122140
}
123141

142+
// If an error message title and message are present, display the error message
124143
if (pennsieveAgentCheckError?.title && pennsieveAgentCheckError?.message) {
125144
return (
126145
<FullWidthContainer>
@@ -142,6 +161,7 @@ const PennsieveAgentCheckDisplay = () => {
142161
);
143162
}
144163

164+
// If the Pennsieve agent is not installed, display a message with a download link
145165
if (pennsieveAgentInstalled === false) {
146166
return (
147167
<FullWidthContainer>
@@ -176,14 +196,16 @@ const PennsieveAgentCheckDisplay = () => {
176196
);
177197
}
178198

179-
if (pennsieveAgentOutputErrorMessage === true) {
199+
// If the Pennsieve agent check returned an error message, display the error message
200+
if (pennsieveAgentOutputErrorMessage != null) {
180201
return (
181202
<FullWidthContainer>
182203
<PennsieveAgentErrorMessageDisplay errorMessage={pennsieveAgentOutputErrorMessage} />
183204
</FullWidthContainer>
184205
);
185206
}
186207

208+
// If the Pennsieve agent is not up to date, display a message with a download link to the latest version
187209
if (pennsieveAgentUpToDate === false) {
188210
return (
189211
<FullWidthContainer>
@@ -223,6 +245,7 @@ const PennsieveAgentCheckDisplay = () => {
223245
);
224246
}
225247

248+
// If the Pennsieve agent check was successful (no flags occurred), display a success message
226249
return (
227250
<FullWidthContainer>
228251
<Stack mt="sm" align="center" mx="sm">

0 commit comments

Comments
 (0)