Skip to content

Codebase: Add AppEnvironment enum #12025

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

Merged
merged 15 commits into from
May 7, 2023

Conversation

hecksmosis
Copy link
Contributor

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Closes Code Quality: Add Environment Enum AppModel #11959
  • (probably) needs more usages

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?
    1. Open app ...
    2. Click settings button ...

Screenshots (optional)
Add screenshots here.

@hecksmosis hecksmosis changed the title Add AppEnvironment enum Codebase: Add AppEnvironment enum Apr 9, 2023
Copy link
Contributor

@lukeblevins lukeblevins left a comment

Choose a reason for hiding this comment

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

We should be using the IHostEnvironment.EnvironmentName property to set the environment like this:

Host.CreateDefaultBuilder(args)
#if SIDELOAD
    .UseEnvironment("Sideload")
#else
    .UseEnvironment("Store")
#endif
    // ...

@yaira2
Copy link
Member

yaira2 commented Apr 10, 2023

We should be using the IHostEnvironment.EnvironmentName property to set the environment like this:

We'll need to add some more configurations, right now sideload and sideload preview use the same configuration but they have different environments.

@hecksmosis
Copy link
Contributor Author

We should be using the IHostEnvironment.EnvironmentName property to set the environment like this:

Host.CreateDefaultBuilder(args)
#if SIDELOAD
    .UseEnvironment("Sideload")
#else
    .UseEnvironment("Store")
#endif
    // ...

How would this be done with the enum?

@yaira2
Copy link
Member

yaira2 commented Apr 17, 2023

@hecksmosis we might have to rework this, Luke's suggestion would be instead of an enum but it won't work unless we add additional configurations to the project. I think it's best to use an enum for now and hold off on implementing IHostEnvironment.EnvironmentName.

@hecksmosis
Copy link
Contributor Author

@hecksmosis we might have to rework this, Luke's suggestion would be instead of an enum but it won't work unless we add additional configurations to the project. I think it's best to use an enum for now and hold off on implementing IHostEnvironment.EnvironmentName.

So should we merge this for the time being or do I modify it?

@yaira2
Copy link
Member

yaira2 commented Apr 23, 2023

@hecksmosis we can merge but I think we should move the code out of app.xaml. The question is to where...

@heftymouse
Copy link
Contributor

Would it be better to set the value using preprocessor directives set by MSBuild instead of reading from the display name?

@yaira2
Copy link
Member

yaira2 commented May 4, 2023

@hecksmosis I created the new project configurations so we can switch away from using the display names.

@hecksmosis
Copy link
Contributor Author

@hecksmosis I created the new project configurations so we can switch away from using the display names.

What are the environment name strings?

@yaira2
Copy link
Member

yaira2 commented May 4, 2023

  • Store
  • Stable
  • Preview
  • Debug
  • Release

@hecksmosis
Copy link
Contributor Author

Is release the dev version?

@yaira2
Copy link
Member

yaira2 commented May 5, 2023

Release and Debug are both dev versions.

@hecksmosis
Copy link
Contributor Author

Ok

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels May 7, 2023
@yaira2 yaira2 merged commit 6bc8c76 into files-community:main May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code Quality: Add Environment Enum AppModel
5 participants