Skip to content

Generating Config Files using CLI tool - #879

Merged
Shyam Sundar J (severussundar) merged 96 commits into
mainfrom
dev/shyamsundarj/generating-config-files-using-scripts
Oct 27, 2022
Merged

Generating Config Files using CLI tool#879
Shyam Sundar J (severussundar) merged 96 commits into
mainfrom
dev/shyamsundarj/generating-config-files-using-scripts

Conversation

@severussundar

@severussundar Shyam Sundar J (severussundar) commented Oct 13, 2022

Copy link
Copy Markdown
Contributor

Why make this change?

What is this change?

  • Text file for each database type containing the dab commands is added in the folder ConfigGenerators

  • Scripts (bash and powershell) are added that reads the command files and executes them using the DAB dll executable

  • A property generateConfigFiles can be specified along with the build command to generate the config files along with the build. Exact build command : dotnet build -p:generateConfigFiles=true

  • Running just dotnet build will build the entire project but skip generating the config files.

  • This gives users the flexibility to generate the config files along with build if they wish to do so.

  • Reference config files for Sql(dab-config.SqlReferenceConfig.json) and Cosmos(dab-config.CosmosReferenceConfig.json) are added.

  • The source type has been modified in the schema to support tables, views and stored-procedures in the config.

  • For local development,

    First, the right connection string needs to be updated in the init command of the respective database command files (The .txt files that contains the dab commands).

    Build should be performed using the command dotnet build -p:generateConfigFiles=true. Running this will generate the config files for all the database types.

    Now, it should be possible to start DAB. At this point, the local branch is ready to perform and validate code changes.

    After making the required code changes, a build can be performed either using dotnet build or dotnet build -p:generateConfigFiles=true. Running, just dotnet build should be fine now, as the config files are already generated, and the delta is the code changes.

    If there are changes made to the command files, then the updated config file can be generated by running the configGenerator script manually using configGenerator.ps1 <database_type>. Runnning dotnet build after that will build the project with the latest config file. Alternatively, dotnet build -p:generateConfigFiles=true can be run. It combines both the config generation and build into a single command

How was this tested?

  • Existing integration tests run successfully with the generated config files
  • Existing unit tests run successfully with the generated config files

Side effects of this change

  • Any change to the config files will need to be done through the CLI commands

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good starter, but looking for the actual scripts - so that it represents the customer scenario.

Comment thread src/Cli/src/Cli.csproj
Comment thread ConfigGenerators/dab-config.CosmosReferenceConfig.json Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks for accommodating the changes to be able to generate the config files manually too.

@severussundar
Shyam Sundar J (severussundar) deleted the dev/shyamsundarj/generating-config-files-using-scripts branch October 27, 2022 05:29
Aniruddh Munde (Aniruddh25) pushed a commit that referenced this pull request Oct 31, 2022
## Why make this change?

- Closes #878 
  - As we removed all the temp config files from our repo, and going forward we would be using cli to generate it. (ref: #879). This document will help users to generate views/stored-procedure using cli.

## What is this change?

- New doc file created under docs/internals.
- updated doc with new command line options.
- Added examples and sample commands along with the generated json objects.
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.

CLI tool: Add a script to generate the config files used in testing

4 participants