Skip to content

Conversation

@twastvedt
Copy link
Contributor

@twastvedt twastvedt commented May 10, 2023

Please Note:

  1. Before submitting the PR, please review How to Contribute to Dynamo
  2. Dynamo Team will meet 1x a month to review PRs found on Github (Issues will be handled separately)
  3. PRs will be reviewed from oldest to newest
  4. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team
  5. PRs should use either Dynamo's default PR template or one of these other template options in order to be considered for review.
  6. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.
  7. PRs made to the DynamoRevit repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after a LGTM label is added to the PR.

Purpose

Cherry-pick #13965 to 2.18.1.

Three issues that we've come across when testing the new Player:

  1. The new (in .net 6 builds) CLI arguments parser, CommandLineParser, by default fails on unknown arguments. Previously we allowed unknown arguments, which is required to allow Player to parse its own additional arguments. With the old parser, NDesk.Options, it is possible to check for invalid arguments but we were not doing that. This PR adds the option IgnoreUnknownArguments, which replicates previous behavior.
  2. A change for service mode changed when we enable file logging. Previously file logging was enabled in CLI mode, now it is not, regardless of whether we're in service mode. This PR fixes that.
  3. In service mode, replaced a reference to ConsoleWriter, which will be null, with Console.WriteLine.

(cherry picked from commit 82c622f)

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

(FILL ME IN) Brief description of the fix / enhancement. Mandatory section

Reviewers

(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)

(FILL ME IN, optional) Any additional notes to reviewers or testers.

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

* Ignore unknown arguments in CLI.

* Enable file logging in cli mode.

* Fix missing ConsoleWriter reference in service mode.

(cherry picked from commit 82c622f)
@twastvedt twastvedt requested a review from QilongTang May 10, 2023 18:22
serviceMode = isServiceMode;

if (!testMode && !isServiceMode)
if ((!testMode || cliMode) && !isServiceMode)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @twastvedt Is the previous check !testMode && !isServiceMode not true before this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not in my testing. I found that testMode was true when I ran the cli. Here, I think: https://github.com/DynamoDS/Dynamo/blob/master/src/DynamoApplications/StartupUtils.cs#L500. The previous constructor, before this PR, only checked cliMode, not testMode.

@QilongTang QilongTang added this to the 2.18.1 milestone May 10, 2023
@QilongTang
Copy link
Contributor

QilongTang commented May 10, 2023

The reported regression is a flaky one. This is ready to be merged and team will work on release version related changes

@twastvedt
Copy link
Contributor Author

Excellent, thanks! Not sure if you were expecting me to merge this. If so, looks like I am not authorized. If not, then disregard this!

@QilongTang
Copy link
Contributor

Excellent, thanks! Not sure if you were expecting me to merge this. If so, looks like I am not authorized. If not, then disregard this!

No worries we will merge it for you later

@QilongTang QilongTang merged commit b9b24e3 into RC2.18.1_master May 11, 2023
@QilongTang QilongTang deleted the AGD-2953-command-line-parser branch May 11, 2023 17:09
@twastvedt twastvedt changed the title AGD-2953: Player CLI fixes (#13965) DYN-5901: Player CLI fixes (#13965) May 18, 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.

3 participants