Skip to content

Commit

Permalink
Merge pull request #303 from cylc/1.3.x-sync
Browse files Browse the repository at this point in the history
🤖 Merge 1.3.x-sync into master
  • Loading branch information
MetRonnie committed Apr 2, 2024
2 parents 3936594 + 5d9ffe1 commit 1d62679
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ ones in. -->
set in ``rose-suite.conf`` to be used when parsing ``global.cylc``.


## __cylc-rose-1.3.3 (<span actions:bind='release-date'>Awaiting Release</span>)__

### Fixes

[#300](https://github.com/cylc/cylc-rose/pull/300) -
Fix issues which could cause "fcm_make" and "rose_prune" tasks intermittently
fail with the message
"Workflow database is incompatible with Cylc x.y.z, or is corrupted".


## __cylc-rose-1.3.2 (<span actions:bind='release-date'>Released 2024-01-18</span>)__

[#284](https://github.com/cylc/cylc-rose/pull/284) - Allow use of Metomi-Rose 2.2.*.
Expand Down
12 changes: 10 additions & 2 deletions cylc/rose/platform_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

from cylc.flow.config import WorkflowConfig
from cylc.flow.id_cli import parse_id
from cylc.flow.pathutil import get_workflow_run_pub_db_path
from cylc.flow.pathutil import (
get_workflow_run_config_log_dir,
get_workflow_run_pub_db_path,
)
from cylc.flow.workflow_files import WorkflowFiles
from cylc.flow.platforms import (
HOST_REC_COMMAND,
get_platform,
Expand All @@ -48,7 +52,11 @@ def get_platform_from_task_def(flow: str, task: str) -> Dict[str, Any]:
Returns:
Platform Dictionary.
"""
_, _, flow_file = parse_id(flow, constraint='workflows', src=True)
workflow_id, _, _ = parse_id(flow, constraint='workflows', src=True)
flow_file = get_workflow_run_config_log_dir(
workflow_id,
WorkflowFiles.FLOW_FILE_PROCESSED,
)
config = WorkflowConfig(flow, flow_file, Values())
# Get entire task spec to allow Cylc 7 platform from host guessing.
task_spec = config.pcfg.get(['runtime', task])
Expand Down
7 changes: 5 additions & 2 deletions tests/unit/test_platform_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def fake_flow():
flow_name: str = f'cylc-rose-platform-utils-test-{str(uuid4())[:6]}'
flow_path = Path(os.path.expandvars('$HOME/cylc-run')) / flow_name
flow_path.mkdir(parents=True)
(flow_path / 'flow.cylc').write_text("""
flow_cylc = flow_path / 'flow.cylc'
flow_cylc.write_text("""
[scheduling]
[[graph]]
R1 = foo & bar & baz & qux & child_of_bar
Expand All @@ -141,10 +142,12 @@ def fake_flow():
[[child_of_bar]]
inherit = BAR
""")
flow_processed = flow_path / 'log/config/flow-processed.cylc'
flow_processed.parent.mkdir(exist_ok=True, parents=True)
flow_processed.symlink_to(flow_path / 'flow.cylc')

# Set up a database
db_file = get_workflow_run_pub_db_path(flow_name)
Path(db_file).parent.mkdir()
with CylcWorkflowDAO(db_file, create_tables=True) as dao:
conn = dao.connect()
conn.execute(
Expand Down

0 comments on commit 1d62679

Please sign in to comment.