Skip to content

Commit

Permalink
Merge pull request #6 from alalkamys/feat/dynamic-configuration
Browse files Browse the repository at this point in the history
Feat: Actor Identity Config is Now Dynamic
  • Loading branch information
alalkamys authored May 16, 2024
2 parents 74849c9 + 41f1fb7 commit e22bd78
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ With `Code Migration Assistant` teams can accelerate the migration of code repos
## Table of contents

<!--ts-->

- [Code Migration Assistant](#code-migration-assistant)
- [Table of contents](#table-of-contents)
- [Key Features](#key-features)
Expand All @@ -34,7 +35,6 @@ With `Code Migration Assistant` teams can accelerate the migration of code repos
- [Environment Variables](#environment-variables)
- [⚔️ Developed By](#️-developed-by)
- [:book: Author](#book-author)
<!--te-->

## Key Features

Expand Down Expand Up @@ -216,7 +216,7 @@ Below is an explanation of each field in the configuration file:

### `targetBranch` (Optional)

- **Description**: Specifies the target branch for the pull request.
- **Description**: Specifies the target branch on which the replacements will occur and will be the source branch for your pull requests.
- **Fields**:
- `name` (required): Name of the target branch.
- `from` (Optional): Source branch from which the target branch is created.
Expand Down Expand Up @@ -286,16 +286,18 @@ Below is an explanation of each field in the configuration file:

## Environment Variables

| Environment Variable | Usage | Default Value |
| ------------------------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------ |
| `CODE_MIGRATION_ASSISTANT_APP_NAME` | Name of the Code Migration Assistant application | `code_migration_assistant` |
| `CODE_MIGRATION_ASSISTANT_LOG_LEVEL` | Log level for the Code Migration Assistant application | `INFO` |
| `CODE_MIGRATION_ASSISTANT_TARGETS_CONFIG_FILE` | Path to the targets configuration file for Code Migration Assistant | `./config.json` |
| `CODE_MIGRATION_ASSISTANT_REMOTE_TARGETS_CLONING_PATH` | Path where remote repositories will be cloned by Code Migration Assistant | `./remote-targets` |
| `AZURE_DEVOPS_PAT` | Azure DevOps Personal Access Token (PAT) | `None` |
| `GITHUB_TOKEN` | GitHub Personal Access Token (PAT) | `None` |
| `GITHUB_ENTERPRISE_TOKEN` | GitHub Enterprise Personal Access Token (PAT) | `None` |
| `CODE_MIGRATION_ASSISTANT_USER_AGENT` | User agent used for HTTP requests by Code Migration Assistant | `alalkamys/code-migration-assistant` |
| Environment Variable | Usage | Default Value |
| ------------------------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------------ |
| `CODE_MIGRATION_ASSISTANT_APP_NAME` | Name of the Code Migration Assistant application | `code_migration_assistant` |
| `CODE_MIGRATION_ASSISTANT_LOG_LEVEL` | Log level for the Code Migration Assistant application | `INFO` |
| `CODE_MIGRATION_ASSISTANT_TARGETS_CONFIG_FILE` | Path to the targets configuration file for Code Migration Assistant | `./config.json` |
| `CODE_MIGRATION_ASSISTANT_REMOTE_TARGETS_CLONING_PATH` | Path where remote repositories will be cloned by Code Migration Assistant | `./remote-targets` |
| `AZURE_DEVOPS_PAT` | Azure DevOps Personal Access Token (PAT) | `None` |
| `GITHUB_TOKEN` | GitHub Personal Access Token (PAT) | `None` |
| `GITHUB_ENTERPRISE_TOKEN` | GitHub Enterprise Personal Access Token (PAT) | `None` |
| `CODE_MIGRATION_ASSISTANT_USER_AGENT` | User agent used for HTTP requests by Code Migration Assistant | `alalkamys/code-migration-assistant` |
| `CODE_MIGRATION_ASSISTANT_ACTOR_USERNAME` | Actor username used for git identity setup | `Code Migration Assistant Agent` |
| `CODE_MIGRATION_ASSISTANT_ACTOR_EMAIL` | Actor email used for git identity setup | `[email protected]` |

<br />

Expand Down
6 changes: 3 additions & 3 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AppConfig:
AZURE_DEVOPS_PAT (str): The Personal Access Token (PAT) for Azure DevOps. Defaults to None.
GITHUB_TOKEN (str): The Personal Access Token (PAT) for GitHub. Defaults to None.
GITHUB_ENTERPRISE_TOKEN (str): The Personal Access Token (PAT) for GitHub Enterprise. Defaults to None.
ACTOR (dict): A dictionary containing the username and email of the application's agent.
ACTOR (dict): A dictionary containing the username and email of the application's agent. Defaults to {'username': "Code Migration Assistant Agent", 'email': "[email protected]"}
USER_AGENT (str): The user agent for making HTTP requests. Defaults to "alalkamys/code-migration-assistant".
LOGGING_CONFIG (dict): Configuration settings for logging.
"""
Expand Down Expand Up @@ -66,8 +66,8 @@ class AppConfig:
GITHUB_ENTERPRISE_TOKEN = os.getenv('GITHUB_ENTERPRISE_TOKEN', None)

ACTOR = {
'username': "Code Migration Assistant Agent",
'email': '[email protected]'
'username': os.getenv('CODE_MIGRATION_ASSISTANT_ACTOR_USERNAME', "Code Migration Assistant Agent"),
'email': os.getenv('CODE_MIGRATION_ASSISTANT_ACTOR_EMAIL', "[email protected]")
}

USER_AGENT = os.getenv(
Expand Down

0 comments on commit e22bd78

Please sign in to comment.