-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1198 from gpt-engineer-org/1197-failed-to-update-…
…new-codes-from-gpte 1197 failed to update new codes from gpte
- Loading branch information
Showing
6 changed files
with
200 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
tests/core/improve_function_test_cases/zbf_yml_missing_chat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
To achieve the separation of environments (stage and local) and to use H2 DB for the local environment, we need to make the following changes: | ||
|
||
1. Create a new `application-local.yml` configuration file for the local environment. | ||
2. Modify the existing `application.yml` to be used for the stage environment. | ||
3. Update the `run.sh` script to handle both environments. | ||
|
||
Let's start with the changes: | ||
|
||
### 1. Create `application-local.yml` for the local environment | ||
|
||
```diff | ||
--- /dev/null | ||
+++ src/main/resources/application-local.yml | ||
@@ -0,0 +1,13 @@ | ||
+spring: | ||
+ datasource: | ||
+ url: jdbc:h2:mem:testdb | ||
+ driver-class-name: org.h2.Driver | ||
+ username: sa | ||
+ password: password | ||
+ h2: | ||
+ console: | ||
+ enabled: true | ||
+ jpa: | ||
+ hibernate: | ||
+ ddl-auto: update | ||
+ show-sql: true | ||
``` | ||
|
||
### 2. Modify `application.yml` to be used for the stage environment | ||
|
||
```diff | ||
--- src/main/resources/application.yml | ||
+++ src/main/resources/application.yml | ||
@@ -1,13 +1,13 @@ | ||
spring: | ||
datasource: | ||
- url: jdbc:postgresql://<RDS_ENDPOINT>:5432/<DB_NAME> | ||
- username: <DB_USERNAME> | ||
- password: <DB_PASSWORD> | ||
+ url: jdbc:postgresql://stage-rds-endpoint:5432/stage_db | ||
+ username: stage_user | ||
+ password: stage_password | ||
driver-class-name: org.postgresql.Driver | ||
jpa: | ||
hibernate: | ||
ddl-auto: update | ||
show-sql: true | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
``` | ||
|
||
|
||
|
||
### 6. Update `application.yml` to include profile-specific configurations | ||
|
||
```diff | ||
--- src/main/resources/application.yml | ||
+++ src/main/resources/application.yml | ||
@@ -1,13 +1,15 @@ | ||
spring: | ||
profiles: | ||
- active: stage | ||
+ active: stage | ||
datasource: | ||
- url: jdbc:postgresql://<RDS_ENDPOINT>:5432/<DB_NAME> | ||
- username: <DB_USERNAME> | ||
- password: <DB_PASSWORD> | ||
+ url: jdbc:postgresql://stage-rds-endpoint:5432/stage_db | ||
+ username: stage_user | ||
+ password: stage_password | ||
driver-class-name: org.postgresql.Driver | ||
jpa: | ||
hibernate: | ||
ddl-auto: update | ||
show-sql: true | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
``` | ||
|
||
### 7. Update `application-local.yml` to include profile-specific configurations | ||
|
||
```diff | ||
--- src/main/resources/application-local.yml | ||
+++ src/main/resources/application-local.yml | ||
@@ -1,13 +1,15 @@ | ||
spring: | ||
profiles: | ||
- active: local | ||
+ active: local | ||
datasource: | ||
- url: jdbc:h2:mem:testdb | ||
- driver-class-name: org.h2.Driver | ||
- username: sa | ||
- password: password | ||
+ url: jdbc:h2:mem:testdb | ||
+ driver-class-name: org.h2.Driver | ||
+ username: sa | ||
+ password: password | ||
h2: | ||
console: | ||
enabled: true | ||
jpa: | ||
hibernate: | ||
ddl-auto: update | ||
show-sql: true | ||
``` |
13 changes: 13 additions & 0 deletions
13
tests/core/improve_function_test_cases/zbf_yml_missing_code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
spring: | ||
datasource: | ||
url: jdbc:postgresql://<RDS_ENDPOINT>:5432/<DB_NAME> | ||
username: <DB_USERNAME> | ||
password: <DB_PASSWORD> | ||
driver-class-name: org.postgresql.Driver | ||
jpa: | ||
hibernate: | ||
ddl-auto: update | ||
show-sql: true | ||
properties: | ||
hibernate: | ||
format_sql: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters