Skip to content

Commit e22bd78

Browse files
authored
Merge pull request #6 from alalkamys/feat/dynamic-configuration
Feat: Actor Identity Config is Now Dynamic
2 parents 74849c9 + 41f1fb7 commit e22bd78

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ With `Code Migration Assistant` teams can accelerate the migration of code repos
1717
## Table of contents
1818

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

3939
## Key Features
4040

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

217217
### `targetBranch` (Optional)
218218

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

287287
## Environment Variables
288288

289-
| Environment Variable | Usage | Default Value |
290-
| ------------------------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------ |
291-
| `CODE_MIGRATION_ASSISTANT_APP_NAME` | Name of the Code Migration Assistant application | `code_migration_assistant` |
292-
| `CODE_MIGRATION_ASSISTANT_LOG_LEVEL` | Log level for the Code Migration Assistant application | `INFO` |
293-
| `CODE_MIGRATION_ASSISTANT_TARGETS_CONFIG_FILE` | Path to the targets configuration file for Code Migration Assistant | `./config.json` |
294-
| `CODE_MIGRATION_ASSISTANT_REMOTE_TARGETS_CLONING_PATH` | Path where remote repositories will be cloned by Code Migration Assistant | `./remote-targets` |
295-
| `AZURE_DEVOPS_PAT` | Azure DevOps Personal Access Token (PAT) | `None` |
296-
| `GITHUB_TOKEN` | GitHub Personal Access Token (PAT) | `None` |
297-
| `GITHUB_ENTERPRISE_TOKEN` | GitHub Enterprise Personal Access Token (PAT) | `None` |
298-
| `CODE_MIGRATION_ASSISTANT_USER_AGENT` | User agent used for HTTP requests by Code Migration Assistant | `alalkamys/code-migration-assistant` |
289+
| Environment Variable | Usage | Default Value |
290+
| ------------------------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------------ |
291+
| `CODE_MIGRATION_ASSISTANT_APP_NAME` | Name of the Code Migration Assistant application | `code_migration_assistant` |
292+
| `CODE_MIGRATION_ASSISTANT_LOG_LEVEL` | Log level for the Code Migration Assistant application | `INFO` |
293+
| `CODE_MIGRATION_ASSISTANT_TARGETS_CONFIG_FILE` | Path to the targets configuration file for Code Migration Assistant | `./config.json` |
294+
| `CODE_MIGRATION_ASSISTANT_REMOTE_TARGETS_CLONING_PATH` | Path where remote repositories will be cloned by Code Migration Assistant | `./remote-targets` |
295+
| `AZURE_DEVOPS_PAT` | Azure DevOps Personal Access Token (PAT) | `None` |
296+
| `GITHUB_TOKEN` | GitHub Personal Access Token (PAT) | `None` |
297+
| `GITHUB_ENTERPRISE_TOKEN` | GitHub Enterprise Personal Access Token (PAT) | `None` |
298+
| `CODE_MIGRATION_ASSISTANT_USER_AGENT` | User agent used for HTTP requests by Code Migration Assistant | `alalkamys/code-migration-assistant` |
299+
| `CODE_MIGRATION_ASSISTANT_ACTOR_USERNAME` | Actor username used for git identity setup | `Code Migration Assistant Agent` |
300+
| `CODE_MIGRATION_ASSISTANT_ACTOR_EMAIL` | Actor email used for git identity setup | `code_migration_assistant_agent@gmail.com` |
299301

300302
<br />
301303

app/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AppConfig:
2121
AZURE_DEVOPS_PAT (str): The Personal Access Token (PAT) for Azure DevOps. Defaults to None.
2222
GITHUB_TOKEN (str): The Personal Access Token (PAT) for GitHub. Defaults to None.
2323
GITHUB_ENTERPRISE_TOKEN (str): The Personal Access Token (PAT) for GitHub Enterprise. Defaults to None.
24-
ACTOR (dict): A dictionary containing the username and email of the application's agent.
24+
ACTOR (dict): A dictionary containing the username and email of the application's agent. Defaults to {'username': "Code Migration Assistant Agent", 'email': "code_migration_assistant_agent@gmail.com"}
2525
USER_AGENT (str): The user agent for making HTTP requests. Defaults to "alalkamys/code-migration-assistant".
2626
LOGGING_CONFIG (dict): Configuration settings for logging.
2727
"""
@@ -66,8 +66,8 @@ class AppConfig:
6666
GITHUB_ENTERPRISE_TOKEN = os.getenv('GITHUB_ENTERPRISE_TOKEN', None)
6767

6868
ACTOR = {
69-
'username': "Code Migration Assistant Agent",
70-
'email': 'code_migration_assistant_agent@gmail.com'
69+
'username': os.getenv('CODE_MIGRATION_ASSISTANT_ACTOR_USERNAME', "Code Migration Assistant Agent"),
70+
'email': os.getenv('CODE_MIGRATION_ASSISTANT_ACTOR_EMAIL', "code_migration_assistant_agent@gmail.com")
7171
}
7272

7373
USER_AGENT = os.getenv(

0 commit comments

Comments
 (0)