App Name and Users Table in anvil.yaml

Could the app name and users table be split out of anvil.yaml and handled differently (e.g. from environment variables)?

Those two entries cause problems when trying to use separate copies of an app for dev/test and staging/production. I use that technique so as to keep data tables and uplink keys separate, but those two lines in anvil.yaml make it very difficult to manage changes between the apps via git without manual intervention.

1 Like

Alternatively, if there’s a way to use git’s ignore features such that anvil.yaml exists only on the anvil side and is never cloned locally, that would be ok.

1 Like

Apologies for ressurecting this old thread, but I’m also having trouble setting Environment Variables. I’m trying to setup manual versions of anvil services. Struggling with App Authentication. Will post discoveries here.

Others have tackled this kind of problem before. Their solutions may be instructive.

The Wing IDE can be set to distinguish between “shared” project parameters and “local” project parameters. The latter include such things as which files were visible in the IDE, where the IDE panes were, location of breakpoints, etc. Each set of parameters is saved to a separate file. This allows the “shared” parameters to be incorporated into version control, without polluting (or being polluted by) the “local” parameters.

In contrast, Embarcadero’s project file contains both local and shared parameters. So only parts of the file should be checked in to version control. (Good luck.)

In Wing’s case, the distinction between “shared” and “local” parameters is made by the IDE’s developer. In the more general case, this distinction should be made by the application developer(s). This allows the development team to standardize on a variety of settings that might otherwise appear to be per-machine or per-developer variables.

How is this normally done? I have no idea. But if I had to invent a scheme, it would apply CVA (Commonality and Variability Analysis) to identify the variables that tend to change together (i.e., the per-project, per-program, per-developer, per-machine, … scopes) and group each distinct set into its own physical text file, for version-control purposes.

The single-file case, e.g., anvil.yaml, is just a special, default case of the above, where everything is in a single file. In the more general case, anvil.yaml would explicitly delegate to other .yaml files, i.e., via some import/include mechanism. You could then explicitly name the other .yaml files after their scope.

I think we’ve gone wildly off-topic from the original Feature Request here, so I’m going to close the thread. If you have new questions or FRs, please post them in new threads!