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

workflow-state command back compat. #5237

Merged
merged 8 commits into from
Aug 24, 2023

Conversation

hjoliver
Copy link
Member

@hjoliver hjoliver commented Nov 23, 2022

Address #5236
Sibling of #5238

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg and conda-environment.yml.
  • Tests are included (or explain why tests are not needed).
  • CHANGES.md entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@hjoliver hjoliver added this to the cylc-8.1.0 milestone Nov 23, 2022
@hjoliver hjoliver self-assigned this Nov 23, 2022
@oliver-sanders oliver-sanders modified the milestones: cylc-8.1.0, cylc-8.2.0 Dec 7, 2022
@oliver-sanders oliver-sanders modified the milestones: cylc-8.2.0, cylc-8.3.0 Jul 11, 2023
@hjoliver hjoliver marked this pull request as ready for review August 21, 2023 06:20
cylc/flow/rundb.py Outdated Show resolved Hide resolved
@hjoliver
Copy link
Member Author

Codecov patch fail is because I'm not testing the cylc workflow-state script directly. I've added a unit test for the underlying functionality though; I think that's sufficient in this case (making a functional test for the script, with old and new DBs, seems more painful than it's worth).

@hjoliver
Copy link
Member Author

hjoliver commented Aug 21, 2023

Re-based to 8.2.x. It's arguably a bug fix, and needed ASAP at NIWA.

@hjoliver hjoliver changed the base branch from master to 8.2.x August 21, 2023 22:56
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but haven't tested

Copy link
Member

@dwsutherland dwsutherland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me 👍
(I would have to build an older VM or use work machines to test)

@dwsutherland
Copy link
Member

dwsutherland commented Aug 22, 2023

The sibling is probably equally important (as some cylc8 workflows may be upstream of cylc7 on migration).
(i.e. a researcher is running cylc7 downstream when we upgrade to cylc8)

Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok managed to test out but it's not working. And the error message only shows up in --debug

DEBUG - [xtrigger-func cmd] cylc function-run workflow_state '[]' '{"workflow": "cylc7-complex", "task": "brief_wagtail_forecast_landsim", "point": "20150219T0000Z"}' ~/cylc-
    run/workflow-state
    [xtrigger-func ret_code] 1
    [xtrigger-func err]
    Traceback (most recent call last):
      File "~/.conda/envs/cylc8/bin/cylc", line 8, in <module>
        sys.exit(main())
      File "~/cylc-flow/cylc/flow/scripts/cylc.py", line 660, in main
        execute_cmd(command, *cmd_args)
      File "~/cylc-flow/cylc/flow/scripts/cylc.py", line 286, in execute_cmd
        entry_point.resolve()(*args)
      File "~/cylc-flow/cylc/flow/scripts/function_run.py", line 41, in main
        run_function(args[1], args[2], args[3], args[4])
      File "~/cylc-flow/cylc/flow/subprocpool.py", line 115, in run_function
        res = func(*func_args, **func_kwargs)
      File "~/cylc-flow/cylc/flow/xtriggers/workflow_state.py", line 93, in workflow_state
        fmt = checker.get_remote_point_format()
      File "~/cylc-flow/cylc/flow/dbstatecheck.py", line 80, in get_remote_point_format
        for row in self.conn.execute(
    sqlite3.OperationalError: no such table: workflow_params
[scheduling]
    [[graph]]
        R1 = @upstream => foo
    [[xtriggers]]
        upstream = workflow_state(workflow=cylc7-complex, task=brief_wagtail_forecast_landsim, point=20150219T0000Z)

Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a fix. May be sensible to add a functional test with a minimal Cylc 7 workflow DB, I can have a look at doing this if you're short on time

@hjoliver
Copy link
Member Author

I've pushed a fix. May be sensible to add a functional test with a minimal Cylc 7 workflow DB, I can have a look at doing this if you're short on time

Argh, last minute non-careful function name change by me, damn it. Thanks for the fix.

@MetRonnie MetRonnie self-assigned this Aug 23, 2023
@MetRonnie
Copy link
Member

@hjoliver Do you want to merge if happy with the test I've added

@hjoliver
Copy link
Member Author

Yes, very happy - thanks @MetRonnie

@hjoliver hjoliver merged commit 17d6012 into cylc:8.2.x Aug 24, 2023
24 of 25 checks passed
@hjoliver hjoliver deleted the workflow-state-back-compat branch August 24, 2023 00:18
@MetRonnie MetRonnie modified the milestones: cylc-8.3.0, cylc-8.2.2 Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants