repo_name stringclasses 5 values | pr_number int64 1.52k 15.5k | pr_title stringlengths 8 143 | pr_description stringlengths 0 10.2k | author stringlengths 3 18 | date_created timestamp[ns, tz=UTC] | date_merged timestamp[ns, tz=UTC] | previous_commit stringlengths 40 40 | pr_commit stringlengths 40 40 | query stringlengths 11 10.2k | filepath stringlengths 6 220 | before_content stringlengths 0 597M | after_content stringlengths 0 597M | label int64 -1 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/helm/README.md | # Apollo Helm Chart
[Apollo](https://github.com/ctripcorp/apollo) is a reliable configuration management system.
## 1. Introduction
The apollo-service and apollo-portal charts create deployments for apollo-configservice, apollo-adminservice and apollo-portal, which utilize the kubernetes native service discovery.
## 2. Prerequisites
- Kubernetes 1.10+
- Helm 3
## 3. Add Apollo Helm Chart Repository
```bash
$ helm repo add apollo https://www.apolloconfig.com/charts
$ helm search repo apollo
```
## 4. Deployments of apollo-configservice and apollo-adminservice
### 4.1 Install
apollo-configservice and apollo-adminservice should be installed per environment, so it is suggested to indicate environment in the release name, e.g. `apollo-service-dev`
```bash
$ helm install apollo-service-dev \
--set configdb.host=1.2.3.4 \
--set configdb.userName=apollo \
--set configdb.password=apollo \
--set configdb.service.enabled=true \
--set configService.replicaCount=1 \
--set adminService.replicaCount=1 \
-n your-namespace \
apollo/apollo-service
```
Or customize it with values.yaml
```bash
$ helm install apollo-service-dev -f values.yaml -n your-namespace apollo/apollo-service
```
### 4.2 Uninstall
To uninstall/delete the `apollo-service-dev` deployment:
```bash
$ helm uninstall -n your-namespace apollo-service-dev
```
### 4.3 Configuration
The following table lists the configurable parameters of the apollo-service chart and their default values.
| Parameter | Description | Default |
|----------------------|---------------------------------------------|---------------------|
| `configdb.host` | The host for apollo config db | `nil` |
| `configdb.port` | The port for apollo config db | `3306` |
| `configdb.dbName` | The database name for apollo config db | `ApolloConfigDB` |
| `configdb.userName` | The user name for apollo config db | `nil` |
| `configdb.password` | The password for apollo config db | `nil` |
| `configdb.connectionStringProperties` | The connection string properties for apollo config db | `characterEncoding=utf8` |
| `configdb.service.enabled` | Whether to create a Kubernetes Service for `configdb.host` or not. Set it to `true` if `configdb.host` is an endpoint outside of the kubernetes cluster | `false` |
| `configdb.service.fullNameOverride` | Override the service name for apollo config db | `nil` |
| `configdb.service.port` | The port for the service of apollo config db | `3306` |
| `configdb.service.type` | The service type of apollo config db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` |
| `configService.fullNameOverride` | Override the deployment name for apollo-configservice | `nil` |
| `configService.replicaCount` | Replica count of apollo-configservice | `2` |
| `configService.containerPort` | Container port of apollo-configservice | `8080` |
| `configService.image.repository` | Image repository of apollo-configservice | `apolloconfig/apollo-configservice` |
| `configService.image.tag` | Image tag of apollo-configservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` |
| `configService.image.pullPolicy` | Image pull policy of apollo-configservice | `IfNotPresent` |
| `configService.imagePullSecrets` | Image pull secrets of apollo-configservice | `[]` |
| `configService.service.fullNameOverride` | Override the service name for apollo-configservice | `nil` |
| `configService.service.port` | The port for the service of apollo-configservice | `8080` |
| `configService.service.targetPort` | The target port for the service of apollo-configservice | `8080` |
| `configService.service.type` | The service type of apollo-configservice | `ClusterIP` |
| `configService.ingress.enabled` | Whether to enable the ingress for config-service or not | `false` |
| `configService.ingress.annotations` | The annotations of the ingress for config-service | `{}` |
| `configService.ingress.hosts.host` | The host of the ingress for config-service | `nil` |
| `configService.ingress.hosts.paths` | The paths of the ingress for config-service | `[]` |
| `configService.ingress.tls` | The tls definition of the ingress for config-service | `[]` |
| `configService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` |
| `configService.liveness.periodSeconds` | The period seconds of liveness probe | `10` |
| `configService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` |
| `configService.readiness.periodSeconds` | The period seconds of readiness probe | `5` |
| `configService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` |
| `configService.config.configServiceUrlOverride` | Override `apollo.config-service.url`: config service url to be accessed by apollo-client | `nil` |
| `configService.config.adminServiceUrlOverride` | Override `apollo.admin-service.url`: admin service url to be accessed by apollo-portal | `nil` |
| `configService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access config service via `http://{config_service_address}/apollo` | `nil` |
| `configService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` |
| `configService.strategy` | The deployment strategy of apollo-configservice | `{}` |
| `configService.resources` | The resources definition of apollo-configservice | `{}` |
| `configService.nodeSelector` | The node selector definition of apollo-configservice | `{}` |
| `configService.tolerations` | The tolerations definition of apollo-configservice | `[]` |
| `configService.affinity` | The affinity definition of apollo-configservice | `{}` |
| `adminService.fullNameOverride` | Override the deployment name for apollo-adminservice | `nil` |
| `adminService.replicaCount` | Replica count of apollo-adminservice | `2` |
| `adminService.containerPort` | Container port of apollo-adminservice | `8090` |
| `adminService.image.repository` | Image repository of apollo-adminservice | `apolloconfig/apollo-adminservice` |
| `adminService.image.tag` | Image tag of apollo-adminservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` |
| `adminService.image.pullPolicy` | Image pull policy of apollo-adminservice | `IfNotPresent` |
| `adminService.imagePullSecrets` | Image pull secrets of apollo-adminservice | `[]` |
| `adminService.service.fullNameOverride` | Override the service name for apollo-adminservice | `nil` |
| `adminService.service.port` | The port for the service of apollo-adminservice | `8090` |
| `adminService.service.targetPort` | The target port for the service of apollo-adminservice | `8090` |
| `adminService.service.type` | The service type of apollo-adminservice | `ClusterIP` |
| `adminService.ingress.enabled` | Whether to enable the ingress for admin-service or not | `false` |
| `adminService.ingress.annotations` | The annotations of the ingress for admin-service | `{}` |
| `adminService.ingress.hosts.host` | The host of the ingress for admin-service | `nil` |
| `adminService.ingress.hosts.paths` | The paths of the ingress for admin-service | `[]` |
| `adminService.ingress.tls` | The tls definition of the ingress for admin-service | `[]` |
| `adminService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` |
| `adminService.liveness.periodSeconds` | The period seconds of liveness probe | `10` |
| `adminService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` |
| `adminService.readiness.periodSeconds` | The period seconds of readiness probe | `5` |
| `adminService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` |
| `adminService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access admin service via `http://{admin_service_address}/apollo` | `nil` |
| `adminService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` |
| `adminService.strategy` | The deployment strategy of apollo-adminservice | `{}` |
| `adminService.resources` | The resources definition of apollo-adminservice | `{}` |
| `adminService.nodeSelector` | The node selector definition of apollo-adminservice | `{}` |
| `adminService.tolerations` | The tolerations definition of apollo-adminservice | `[]` |
| `adminService.affinity` | The affinity definition of apollo-adminservice | `{}` |
### 4.4 Sample
1. ConfigDB host is an IP outside of kubernetes cluster
```yaml
configdb:
host: 1.2.3.4
dbName: ApolloConfigDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
```
2. ConfigDB host is a dns name outside of kubernetes cluster
```yaml
configdb:
host: xxx.mysql.rds.aliyuncs.com
dbName: ApolloConfigDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
type: ExternalName
```
3. ConfigDB host is a kubernetes service
```yaml
configdb:
host: apollodb-mysql.mysql
dbName: ApolloConfigDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
```
4. Expose config service as Ingress with custom path `/config`
```yaml
# use /config as root, should specify configService.config.contextPath as /config
configService:
config:
contextPath: /config
ingress:
enabled: true
hosts:
- paths:
- /config
```
5. Expose admin service as Ingress with custom path `/admin`
```yaml
# use /admin as root, should specify adminService.config.contextPath as /admin
adminService:
config:
contextPath: /admin
ingress:
enabled: true
hosts:
- paths:
- /admin
```
## 5. Deployments of apollo-portal
### 5.1 Install
To install the apollo-portal chart with the release name `apollo-portal`:
```bash
$ helm install apollo-portal \
--set portaldb.host=1.2.3.4 \
--set portaldb.userName=apollo \
--set portaldb.password=apollo \
--set portaldb.service.enabled=true \
--set config.envs="dev\,pro" \
--set config.metaServers.dev=http://apollo-service-dev-apollo-configservice:8080 \
--set config.metaServers.pro=http://apollo-service-pro-apollo-configservice:8080 \
--set replicaCount=1 \
-n your-namespace \
apollo/apollo-portal
```
Or customize it with values.yaml
```bash
$ helm install apollo-portal -f values.yaml -n your-namespace apollo/apollo-portal
```
### 5.2 Uninstallation
To uninstall/delete the `apollo-portal` deployment:
```bash
$ helm uninstall -n your-namespace apollo-portal
```
### 5.3 Configuration
The following table lists the configurable parameters of the apollo-portal chart and their default values.
| Parameter | Description | Default |
|----------------------|---------------------------------------------|-----------------------|
| `fullNameOverride` | Override the deployment name for apollo-portal | `nil` |
| `replicaCount` | Replica count of apollo-portal | `2` |
| `containerPort` | Container port of apollo-portal | `8070` |
| `image.repository` | Image repository of apollo-portal | `apolloconfig/apollo-portal` |
| `image.tag` | Image tag of apollo-portal, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` |
| `image.pullPolicy` | Image pull policy of apollo-portal | `IfNotPresent` |
| `imagePullSecrets` | Image pull secrets of apollo-portal | `[]` |
| `service.fullNameOverride` | Override the service name for apollo-portal | `nil` |
| `service.port` | The port for the service of apollo-portal | `8070` |
| `service.targetPort` | The target port for the service of apollo-portal | `8070` |
| `service.type` | The service type of apollo-portal | `ClusterIP` |
| `service.sessionAffinity` | The session affinity for the service of apollo-portal | `ClientIP` |
| `ingress.enabled` | Whether to enable the ingress or not | `false` |
| `ingress.annotations` | The annotations of the ingress | `{}` |
| `ingress.hosts.host` | The host of the ingress | `nil` |
| `ingress.hosts.paths` | The paths of the ingress | `[]` |
| `ingress.tls` | The tls definition of the ingress | `[]` |
| `liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` |
| `liveness.periodSeconds` | The period seconds of liveness probe | `10` |
| `readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` |
| `readiness.periodSeconds` | The period seconds of readiness probe | `5` |
| `env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` |
| `strategy` | The deployment strategy of apollo-portal | `{}` |
| `resources` | The resources definition of apollo-portal | `{}` |
| `nodeSelector` | The node selector definition of apollo-portal | `{}` |
| `tolerations` | The tolerations definition of apollo-portal | `[]` |
| `affinity` | The affinity definition of apollo-portal | `{}` |
| `config.profiles` | specify the spring profiles to activate | `github,auth` |
| `config.envs` | specify the env names, e.g. dev,pro | `nil` |
| `config.contextPath` | specify the context path, e.g. `/apollo`, then users could access portal via `http://{portal_address}/apollo` | `nil` |
| `config.metaServers` | specify the meta servers, e.g.<br />`dev: http://apollo-configservice-dev:8080`<br />`pro: http://apollo-configservice-pro:8080` | `{}` |
| `config.files` | specify the extra config files for apollo-portal, e.g. application-ldap.yml | `{}` |
| `portaldb.host` | The host for apollo portal db | `nil` |
| `portaldb.port` | The port for apollo portal db | `3306` |
| `portaldb.dbName` | The database name for apollo portal db | `ApolloPortalDB` |
| `portaldb.userName` | The user name for apollo portal db | `nil` |
| `portaldb.password` | The password for apollo portal db | `nil` |
| `portaldb.connectionStringProperties` | The connection string properties for apollo portal db | `characterEncoding=utf8` |
| `portaldb.service.enabled` | Whether to create a Kubernetes Service for `portaldb.host` or not. Set it to `true` if `portaldb.host` is an endpoint outside of the kubernetes cluster | `false` |
| `portaldb.service.fullNameOverride` | Override the service name for apollo portal db | `nil` |
| `portaldb.service.port` | The port for the service of apollo portal db | `3306` |
| `portaldb.service.type` | The service type of apollo portal db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` |
### 5.4 Sample
1. PortalDB host is an IP outside of kubernetes cluster
```yaml
portaldb:
host: 1.2.3.4
dbName: ApolloPortalDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
```
2. PortalDB host is a dns name outside of kubernetes cluster
```yaml
portaldb:
host: xxx.mysql.rds.aliyuncs.com
dbName: ApolloPortalDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
type: ExternalName
```
3. PortalDB host is a kubernetes service
```yaml
portaldb:
host: apollodb-mysql.mysql
dbName: ApolloPortalDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
```
4. Specify environments
```yaml
config:
envs: dev,pro
metaServers:
dev: http://apollo-service-dev-apollo-configservice:8080
pro: http://apollo-service-pro-apollo-configservice:8080
```
5. Expose service as Load Balancer
```yaml
service:
type: LoadBalancer
```
6. Expose service as Ingress
```yaml
ingress:
enabled: true
hosts:
- paths:
- /
```
7. Expose service as Ingress with custom path `/apollo`
```yaml
# use /apollo as root, should specify config.contextPath as /apollo
ingress:
enabled: true
hosts:
- paths:
- /apollo
config:
...
contextPath: /apollo
...
```
8. Expose service as Ingress with session affinity
```yaml
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/affinity-mode: "persistent"
nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
hosts:
- host: xxx.somedomain.com # host is required to make session affinity work
paths:
- /
```
9. Enable LDAP support
```yaml
config:
...
profiles: github,ldap
...
files:
application-ldap.yml: |
spring:
ldap:
base: "dc=example,dc=org"
username: "cn=admin,dc=example,dc=org"
password: "password"
searchFilter: "(uid={0})"
urls:
- "ldap://xxx.somedomain.com:389"
ldap:
mapping:
objectClass: "inetOrgPerson"
loginId: "uid"
userDisplayName: "cn"
email: "mail"
``` | # Apollo Helm Chart
[Apollo](https://github.com/ctripcorp/apollo) is a reliable configuration management system.
## 1. Introduction
The apollo-service and apollo-portal charts create deployments for apollo-configservice, apollo-adminservice and apollo-portal, which utilize the kubernetes native service discovery.
## 2. Prerequisites
- Kubernetes 1.10+
- Helm 3
## 3. Add Apollo Helm Chart Repository
```bash
$ helm repo add apollo https://www.apolloconfig.com/charts
$ helm search repo apollo
```
## 4. Deployments of apollo-configservice and apollo-adminservice
### 4.1 Install
apollo-configservice and apollo-adminservice should be installed per environment, so it is suggested to indicate environment in the release name, e.g. `apollo-service-dev`
```bash
$ helm install apollo-service-dev \
--set configdb.host=1.2.3.4 \
--set configdb.userName=apollo \
--set configdb.password=apollo \
--set configdb.service.enabled=true \
--set configService.replicaCount=1 \
--set adminService.replicaCount=1 \
-n your-namespace \
apollo/apollo-service
```
Or customize it with values.yaml
```bash
$ helm install apollo-service-dev -f values.yaml -n your-namespace apollo/apollo-service
```
### 4.2 Uninstall
To uninstall/delete the `apollo-service-dev` deployment:
```bash
$ helm uninstall -n your-namespace apollo-service-dev
```
### 4.3 Configuration
The following table lists the configurable parameters of the apollo-service chart and their default values.
| Parameter | Description | Default |
|----------------------|---------------------------------------------|---------------------|
| `configdb.host` | The host for apollo config db | `nil` |
| `configdb.port` | The port for apollo config db | `3306` |
| `configdb.dbName` | The database name for apollo config db | `ApolloConfigDB` |
| `configdb.userName` | The user name for apollo config db | `nil` |
| `configdb.password` | The password for apollo config db | `nil` |
| `configdb.connectionStringProperties` | The connection string properties for apollo config db | `characterEncoding=utf8` |
| `configdb.service.enabled` | Whether to create a Kubernetes Service for `configdb.host` or not. Set it to `true` if `configdb.host` is an endpoint outside of the kubernetes cluster | `false` |
| `configdb.service.fullNameOverride` | Override the service name for apollo config db | `nil` |
| `configdb.service.port` | The port for the service of apollo config db | `3306` |
| `configdb.service.type` | The service type of apollo config db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` |
| `configService.fullNameOverride` | Override the deployment name for apollo-configservice | `nil` |
| `configService.replicaCount` | Replica count of apollo-configservice | `2` |
| `configService.containerPort` | Container port of apollo-configservice | `8080` |
| `configService.image.repository` | Image repository of apollo-configservice | `apolloconfig/apollo-configservice` |
| `configService.image.tag` | Image tag of apollo-configservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` |
| `configService.image.pullPolicy` | Image pull policy of apollo-configservice | `IfNotPresent` |
| `configService.imagePullSecrets` | Image pull secrets of apollo-configservice | `[]` |
| `configService.service.fullNameOverride` | Override the service name for apollo-configservice | `nil` |
| `configService.service.port` | The port for the service of apollo-configservice | `8080` |
| `configService.service.targetPort` | The target port for the service of apollo-configservice | `8080` |
| `configService.service.type` | The service type of apollo-configservice | `ClusterIP` |
| `configService.ingress.enabled` | Whether to enable the ingress for config-service or not | `false` |
| `configService.ingress.annotations` | The annotations of the ingress for config-service | `{}` |
| `configService.ingress.hosts.host` | The host of the ingress for config-service | `nil` |
| `configService.ingress.hosts.paths` | The paths of the ingress for config-service | `[]` |
| `configService.ingress.tls` | The tls definition of the ingress for config-service | `[]` |
| `configService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` |
| `configService.liveness.periodSeconds` | The period seconds of liveness probe | `10` |
| `configService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` |
| `configService.readiness.periodSeconds` | The period seconds of readiness probe | `5` |
| `configService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` |
| `configService.config.configServiceUrlOverride` | Override `apollo.config-service.url`: config service url to be accessed by apollo-client | `nil` |
| `configService.config.adminServiceUrlOverride` | Override `apollo.admin-service.url`: admin service url to be accessed by apollo-portal | `nil` |
| `configService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access config service via `http://{config_service_address}/apollo` | `nil` |
| `configService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` |
| `configService.strategy` | The deployment strategy of apollo-configservice | `{}` |
| `configService.resources` | The resources definition of apollo-configservice | `{}` |
| `configService.nodeSelector` | The node selector definition of apollo-configservice | `{}` |
| `configService.tolerations` | The tolerations definition of apollo-configservice | `[]` |
| `configService.affinity` | The affinity definition of apollo-configservice | `{}` |
| `adminService.fullNameOverride` | Override the deployment name for apollo-adminservice | `nil` |
| `adminService.replicaCount` | Replica count of apollo-adminservice | `2` |
| `adminService.containerPort` | Container port of apollo-adminservice | `8090` |
| `adminService.image.repository` | Image repository of apollo-adminservice | `apolloconfig/apollo-adminservice` |
| `adminService.image.tag` | Image tag of apollo-adminservice, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` |
| `adminService.image.pullPolicy` | Image pull policy of apollo-adminservice | `IfNotPresent` |
| `adminService.imagePullSecrets` | Image pull secrets of apollo-adminservice | `[]` |
| `adminService.service.fullNameOverride` | Override the service name for apollo-adminservice | `nil` |
| `adminService.service.port` | The port for the service of apollo-adminservice | `8090` |
| `adminService.service.targetPort` | The target port for the service of apollo-adminservice | `8090` |
| `adminService.service.type` | The service type of apollo-adminservice | `ClusterIP` |
| `adminService.ingress.enabled` | Whether to enable the ingress for admin-service or not | `false` |
| `adminService.ingress.annotations` | The annotations of the ingress for admin-service | `{}` |
| `adminService.ingress.hosts.host` | The host of the ingress for admin-service | `nil` |
| `adminService.ingress.hosts.paths` | The paths of the ingress for admin-service | `[]` |
| `adminService.ingress.tls` | The tls definition of the ingress for admin-service | `[]` |
| `adminService.liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` |
| `adminService.liveness.periodSeconds` | The period seconds of liveness probe | `10` |
| `adminService.readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` |
| `adminService.readiness.periodSeconds` | The period seconds of readiness probe | `5` |
| `adminService.config.profiles` | specify the spring profiles to activate | `github,kubernetes` |
| `adminService.config.contextPath` | specify the context path, e.g. `/apollo`, then users could access admin service via `http://{admin_service_address}/apollo` | `nil` |
| `adminService.env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` |
| `adminService.strategy` | The deployment strategy of apollo-adminservice | `{}` |
| `adminService.resources` | The resources definition of apollo-adminservice | `{}` |
| `adminService.nodeSelector` | The node selector definition of apollo-adminservice | `{}` |
| `adminService.tolerations` | The tolerations definition of apollo-adminservice | `[]` |
| `adminService.affinity` | The affinity definition of apollo-adminservice | `{}` |
### 4.4 Sample
1. ConfigDB host is an IP outside of kubernetes cluster
```yaml
configdb:
host: 1.2.3.4
dbName: ApolloConfigDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
```
2. ConfigDB host is a dns name outside of kubernetes cluster
```yaml
configdb:
host: xxx.mysql.rds.aliyuncs.com
dbName: ApolloConfigDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
type: ExternalName
```
3. ConfigDB host is a kubernetes service
```yaml
configdb:
host: apollodb-mysql.mysql
dbName: ApolloConfigDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
```
4. Expose config service as Ingress with custom path `/config`
```yaml
# use /config as root, should specify configService.config.contextPath as /config
configService:
config:
contextPath: /config
ingress:
enabled: true
hosts:
- paths:
- /config
```
5. Expose admin service as Ingress with custom path `/admin`
```yaml
# use /admin as root, should specify adminService.config.contextPath as /admin
adminService:
config:
contextPath: /admin
ingress:
enabled: true
hosts:
- paths:
- /admin
```
## 5. Deployments of apollo-portal
### 5.1 Install
To install the apollo-portal chart with the release name `apollo-portal`:
```bash
$ helm install apollo-portal \
--set portaldb.host=1.2.3.4 \
--set portaldb.userName=apollo \
--set portaldb.password=apollo \
--set portaldb.service.enabled=true \
--set config.envs="dev\,pro" \
--set config.metaServers.dev=http://apollo-service-dev-apollo-configservice:8080 \
--set config.metaServers.pro=http://apollo-service-pro-apollo-configservice:8080 \
--set replicaCount=1 \
-n your-namespace \
apollo/apollo-portal
```
Or customize it with values.yaml
```bash
$ helm install apollo-portal -f values.yaml -n your-namespace apollo/apollo-portal
```
### 5.2 Uninstallation
To uninstall/delete the `apollo-portal` deployment:
```bash
$ helm uninstall -n your-namespace apollo-portal
```
### 5.3 Configuration
The following table lists the configurable parameters of the apollo-portal chart and their default values.
| Parameter | Description | Default |
|----------------------|---------------------------------------------|-----------------------|
| `fullNameOverride` | Override the deployment name for apollo-portal | `nil` |
| `replicaCount` | Replica count of apollo-portal | `2` |
| `containerPort` | Container port of apollo-portal | `8070` |
| `image.repository` | Image repository of apollo-portal | `apolloconfig/apollo-portal` |
| `image.tag` | Image tag of apollo-portal, e.g. `1.8.0`, leave it to `nil` to use the default version | `nil` |
| `image.pullPolicy` | Image pull policy of apollo-portal | `IfNotPresent` |
| `imagePullSecrets` | Image pull secrets of apollo-portal | `[]` |
| `service.fullNameOverride` | Override the service name for apollo-portal | `nil` |
| `service.port` | The port for the service of apollo-portal | `8070` |
| `service.targetPort` | The target port for the service of apollo-portal | `8070` |
| `service.type` | The service type of apollo-portal | `ClusterIP` |
| `service.sessionAffinity` | The session affinity for the service of apollo-portal | `ClientIP` |
| `ingress.enabled` | Whether to enable the ingress or not | `false` |
| `ingress.annotations` | The annotations of the ingress | `{}` |
| `ingress.hosts.host` | The host of the ingress | `nil` |
| `ingress.hosts.paths` | The paths of the ingress | `[]` |
| `ingress.tls` | The tls definition of the ingress | `[]` |
| `liveness.initialDelaySeconds` | The initial delay seconds of liveness probe | `100` |
| `liveness.periodSeconds` | The period seconds of liveness probe | `10` |
| `readiness.initialDelaySeconds` | The initial delay seconds of readiness probe | `30` |
| `readiness.periodSeconds` | The period seconds of readiness probe | `5` |
| `env` | Environment variables passed to the container, e.g. <br />`JAVA_OPTS: -Xss256k` | `{}` |
| `strategy` | The deployment strategy of apollo-portal | `{}` |
| `resources` | The resources definition of apollo-portal | `{}` |
| `nodeSelector` | The node selector definition of apollo-portal | `{}` |
| `tolerations` | The tolerations definition of apollo-portal | `[]` |
| `affinity` | The affinity definition of apollo-portal | `{}` |
| `config.profiles` | specify the spring profiles to activate | `github,auth` |
| `config.envs` | specify the env names, e.g. dev,pro | `nil` |
| `config.contextPath` | specify the context path, e.g. `/apollo`, then users could access portal via `http://{portal_address}/apollo` | `nil` |
| `config.metaServers` | specify the meta servers, e.g.<br />`dev: http://apollo-configservice-dev:8080`<br />`pro: http://apollo-configservice-pro:8080` | `{}` |
| `config.files` | specify the extra config files for apollo-portal, e.g. application-ldap.yml | `{}` |
| `portaldb.host` | The host for apollo portal db | `nil` |
| `portaldb.port` | The port for apollo portal db | `3306` |
| `portaldb.dbName` | The database name for apollo portal db | `ApolloPortalDB` |
| `portaldb.userName` | The user name for apollo portal db | `nil` |
| `portaldb.password` | The password for apollo portal db | `nil` |
| `portaldb.connectionStringProperties` | The connection string properties for apollo portal db | `characterEncoding=utf8` |
| `portaldb.service.enabled` | Whether to create a Kubernetes Service for `portaldb.host` or not. Set it to `true` if `portaldb.host` is an endpoint outside of the kubernetes cluster | `false` |
| `portaldb.service.fullNameOverride` | Override the service name for apollo portal db | `nil` |
| `portaldb.service.port` | The port for the service of apollo portal db | `3306` |
| `portaldb.service.type` | The service type of apollo portal db: `ClusterIP` or `ExternalName`. If the host is a DNS name, please specify `ExternalName` as the service type, e.g. xxx.mysql.rds.aliyuncs.com | `ClusterIP` |
### 5.4 Sample
1. PortalDB host is an IP outside of kubernetes cluster
```yaml
portaldb:
host: 1.2.3.4
dbName: ApolloPortalDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
```
2. PortalDB host is a dns name outside of kubernetes cluster
```yaml
portaldb:
host: xxx.mysql.rds.aliyuncs.com
dbName: ApolloPortalDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
type: ExternalName
```
3. PortalDB host is a kubernetes service
```yaml
portaldb:
host: apollodb-mysql.mysql
dbName: ApolloPortalDBName
userName: someUserName
password: somePassword
connectionStringProperties: characterEncoding=utf8&useSSL=false
```
4. Specify environments
```yaml
config:
envs: dev,pro
metaServers:
dev: http://apollo-service-dev-apollo-configservice:8080
pro: http://apollo-service-pro-apollo-configservice:8080
```
5. Expose service as Load Balancer
```yaml
service:
type: LoadBalancer
```
6. Expose service as Ingress
```yaml
ingress:
enabled: true
hosts:
- paths:
- /
```
7. Expose service as Ingress with custom path `/apollo`
```yaml
# use /apollo as root, should specify config.contextPath as /apollo
ingress:
enabled: true
hosts:
- paths:
- /apollo
config:
...
contextPath: /apollo
...
```
8. Expose service as Ingress with session affinity
```yaml
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/affinity-mode: "persistent"
nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
hosts:
- host: xxx.somedomain.com # host is required to make session affinity work
paths:
- /
```
9. Enable LDAP support
```yaml
config:
...
profiles: github,ldap
...
files:
application-ldap.yml: |
spring:
ldap:
base: "dc=example,dc=org"
username: "cn=admin,dc=example,dc=org"
password: "password"
searchFilter: "(uid={0})"
urls:
- "ldap://xxx.somedomain.com:389"
ldap:
mapping:
objectClass: "inetOrgPerson"
loginId: "uid"
userDisplayName: "cn"
email: "mail"
``` | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest2.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest11.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-buildtools/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-buildtools</artifactId>
<name>Apollo BuildTools</name>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>src/main/scripts</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-buildtools</artifactId>
<name>Apollo BuildTools</name>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>src/main/scripts</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-adminservice/src/test/resources/logback-test.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest10.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config />
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderAutoUpdateTest.TestAllKindsOfDataTypesBean">
<property name="intProperty" value="${intProperty}"/>
<property name="intArrayProperty" value="${intArrayProperty}"/>
<property name="longProperty" value="${longProperty}"/>
<property name="shortProperty" value="${shortProperty}"/>
<property name="floatProperty" value="${floatProperty}"/>
<property name="doubleProperty" value="${doubleProperty}"/>
<property name="byteProperty" value="${byteProperty}"/>
<property name="booleanProperty" value="${booleanProperty}"/>
<property name="stringProperty" value="${stringProperty}"/>
<property name="dateProperty" value="#{new java.text.SimpleDateFormat('${dateFormat}').parse('${dateProperty}')}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config />
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderAutoUpdateTest.TestAllKindsOfDataTypesBean">
<property name="intProperty" value="${intProperty}"/>
<property name="intArrayProperty" value="${intArrayProperty}"/>
<property name="longProperty" value="${longProperty}"/>
<property name="shortProperty" value="${shortProperty}"/>
<property name="floatProperty" value="${floatProperty}"/>
<property name="doubleProperty" value="${doubleProperty}"/>
<property name="byteProperty" value="${byteProperty}"/>
<property name="booleanProperty" value="${booleanProperty}"/>
<property name="stringProperty" value="${stringProperty}"/>
<property name="dateProperty" value="#{new java.text.SimpleDateFormat('${dateFormat}').parse('${dateProperty}')}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-adminservice/src/assembly/assembly-descriptor.xml | <!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<excludes>
<exclude>apollo-adminservice.conf</exclude>
<exclude>application-github.properties</exclude>
</excludes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-adminservice.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| <!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<excludes>
<exclude>apollo-adminservice.conf</exclude>
<exclude>application-github.properties</exclude>
</excludes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-adminservice.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest5.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application" order="abc"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application" order="abc"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./GOVERNANCE.md | # Overview
Apollo is a meritocratic, consensus-based community project. Anyone with an interest in the project can join the community, contribute to the project design and participate in the decision-making process.
This document describes how that participation takes place and how to set about earning merit within the project community.
# Roles and Responsibilities
Apollo community is composed of and operated by the following roles:
- Users
- Contributors
- Committers
- Project Management Committee (PMC)
## Users
Users are community members who have a need for the project. They are the most important members of the community and without them the project would have no purpose. Anyone can be a user and there are no special requirements.
## Contributors
Contributors are community members who contribute in concrete ways to the project.
### How to become a Contributor
- merged at least 1 pull request
You are also encouraged to participate in the projects in the following ways:
- Actively answer technical questions raised by community users in GitHub issues.
- Help test the projects
- Help review the pull requests (PRs) submitted by others
- Help improve technical documents
- Submit valuable issues
- Report or fix known and unknown bugs
- Write articles about source code analysis and usage cases for a project.
- Give representations of Apollo topic in conferences.
- Take part in our discussions of features, enhancements, etc.
## Committers
Committers are contributors who have shown that they are committed to the continued development of the project through ongoing engagement with the community and recognized by PMCs for their outstanding contributions.
### How to become a Committer
A Committer must have accomplished one or more of the following items:
- Demonstrated a good sense of responsibility in PR reviews.
- Demonstrated deep understanding of Apollo components by contributing significantly as:
- Finished 2 or more tasks of Medium difficulty
- Fixed 1 or more tasks of Hard difficulty
- Nominated by one PMC member and gained more +1 than -1.
### Privileges and responsibilities
- Control overall code quality of projects
- Guide Contributors to contribute to the community continuously
- Participate in design discussions
## Project Management Committee
The PMC(Project Management Committee) functions as the core management team that oversees the Apollo community. The PMC has additional responsibilities over and above those of Committers. These responsibilities ensure the smooth running of the project.
### How to become a PMC member
- Membership of the PMC is by invitation from the existing PMC members.
- A nomination will result in discussion and then a vote by the existing PMC members.
- PMC membership votes are subject to consensus approval of the current PMC members.
### Privileges and responsibilities
- Handle reported security issues (CVE, etc.)
- Nominate new committers and PMC members
- Vote on new committers and new PMC members
- Make major decisions for the future with respect to Apollo, such as project-level governance policies, management of sub-structures, security processes and so on
- Make decisions when community consensus cannot be reached
# Decision-making and voting
Proposals and ideas can be submitted for agreement via a GitHub issue, PR, or GitHub Discussion.
Major changes such as feature proposals and organization or process changes should be brought to the PMC. For the change to happen, the change must earn more +1 than -1.
# Conflict resolution
In general, we prefer that technical issues and other disputes upon which consensus can't be reached are amicably worked out between the persons involved. If a dispute cannot be decided independently, the PMC can be called in to resolve the issue by voting. The same PR can be used, or a separate PR can be opened for voting.
# Changes in Governance
Any change in this Governance document, or similar nature of changes to other governance related documents, shall go through the voting process as described in [Decision-making and voting](#decision-making-and-voting).
# Credits
The contents of this document are based on <http://oss-watch.ac.uk/resources/meritocraticgovernancemodel> by Ross Gardler and Gabriel Hanganu, and [TiDB Governance](https://github.com/pingcap/community/blob/master/GOVERNANCE.md).
| # Overview
Apollo is a meritocratic, consensus-based community project. Anyone with an interest in the project can join the community, contribute to the project design and participate in the decision-making process.
This document describes how that participation takes place and how to set about earning merit within the project community.
# Roles and Responsibilities
Apollo community is composed of and operated by the following roles:
- Users
- Contributors
- Committers
- Project Management Committee (PMC)
## Users
Users are community members who have a need for the project. They are the most important members of the community and without them the project would have no purpose. Anyone can be a user and there are no special requirements.
## Contributors
Contributors are community members who contribute in concrete ways to the project.
### How to become a Contributor
- merged at least 1 pull request
You are also encouraged to participate in the projects in the following ways:
- Actively answer technical questions raised by community users in GitHub issues.
- Help test the projects
- Help review the pull requests (PRs) submitted by others
- Help improve technical documents
- Submit valuable issues
- Report or fix known and unknown bugs
- Write articles about source code analysis and usage cases for a project.
- Give representations of Apollo topic in conferences.
- Take part in our discussions of features, enhancements, etc.
## Committers
Committers are contributors who have shown that they are committed to the continued development of the project through ongoing engagement with the community and recognized by PMCs for their outstanding contributions.
### How to become a Committer
A Committer must have accomplished one or more of the following items:
- Demonstrated a good sense of responsibility in PR reviews.
- Demonstrated deep understanding of Apollo components by contributing significantly as:
- Finished 2 or more tasks of Medium difficulty
- Fixed 1 or more tasks of Hard difficulty
- Nominated by one PMC member and gained more +1 than -1.
### Privileges and responsibilities
- Control overall code quality of projects
- Guide Contributors to contribute to the community continuously
- Participate in design discussions
## Project Management Committee
The PMC(Project Management Committee) functions as the core management team that oversees the Apollo community. The PMC has additional responsibilities over and above those of Committers. These responsibilities ensure the smooth running of the project.
### How to become a PMC member
- Membership of the PMC is by invitation from the existing PMC members.
- A nomination will result in discussion and then a vote by the existing PMC members.
- PMC membership votes are subject to consensus approval of the current PMC members.
### Privileges and responsibilities
- Handle reported security issues (CVE, etc.)
- Nominate new committers and PMC members
- Vote on new committers and new PMC members
- Make major decisions for the future with respect to Apollo, such as project-level governance policies, management of sub-structures, security processes and so on
- Make decisions when community consensus cannot be reached
# Decision-making and voting
Proposals and ideas can be submitted for agreement via a GitHub issue, PR, or GitHub Discussion.
Major changes such as feature proposals and organization or process changes should be brought to the PMC. For the change to happen, the change must earn more +1 than -1.
# Conflict resolution
In general, we prefer that technical issues and other disputes upon which consensus can't be reached are amicably worked out between the persons involved. If a dispute cannot be decided independently, the PMC can be called in to resolve the issue by voting. The same PR can be used, or a separate PR can be opened for voting.
# Changes in Governance
Any change in this Governance document, or similar nature of changes to other governance related documents, shall go through the voting process as described in [Decision-making and voting](#decision-making-and-voting).
# Credits
The contents of this document are based on <http://oss-watch.ac.uk/resources/meritocraticgovernancemodel> by Ross Gardler and Gabriel Hanganu, and [TiDB Governance](https://github.com/pingcap/community/blob/master/GOVERNANCE.md).
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./SECURITY.md | # Security Policy
## Reporting a Vulnerability
If you have apprehensions regarding Apollo's security or you discover vulnerability or potential threat, don’t hesitate to get in touch with us by dropping a mail at apollo-config@googlegroups.com.
In the mail, specify the description of the issue or potential threat. You are also urged to recommend the way to reproduce and replicate the issue. The Apollo community will get back to you after assessing and analysing the findings.
PLEASE PAY ATTENTION to report the security issue on the security email before disclosing it on public domain.
| # Security Policy
## Reporting a Vulnerability
If you have apprehensions regarding Apollo's security or you discover vulnerability or potential threat, don’t hesitate to get in touch with us by dropping a mail at apollo-config@googlegroups.com.
In the mail, specify the description of the issue or potential threat. You are also urged to recommend the way to reproduce and replicate the issue. The Apollo community will get back to you after assessing and analysing the findings.
PLEASE PAY ATTENTION to report the security issue on the security email before disclosing it on public domain.
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/config.namespace.placeholder.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="${xxx.from.system.property}"/>
<apollo:config namespaces="${yyy.from.system.property}" order="10"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="${xxx.from.system.property}"/>
<apollo:config namespaces="${yyy.from.system.property}" order="10"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/assembly/assembly-descriptor.xml | <!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>app.properties</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-portal.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
<include>apollo-env.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| <!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>app.properties</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-portal.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
<include>apollo-env.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./.github/ISSUE_TEMPLATE/bug_report_en.md | ---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
<!-- The content in here will not be show。To forbid duplication,easier search in the feature,before you create an issue,please check the following. If your question is a newer/beginner's,recommand to https://github.com/ctripcorp/apollo/discussions to ask it. -->
- [ ] I have checked the [discussions](https://github.com/ctripcorp/apollo/discussions)
- [ ] I have searched the [issues](https://github.com/ctripcorp/apollo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://www.apolloconfig.com/#/zh/faq/common-issues-in-deployment-and-development-phase) of this repository and believe that this is not a duplicate.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1.
2.
3.
4.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
### Additional Details & Logs
- Version
- Error logs
- Configuration
- Platform and Operating System
| ---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
<!-- The content in here will not be show。To forbid duplication,easier search in the feature,before you create an issue,please check the following. If your question is a newer/beginner's,recommand to https://github.com/ctripcorp/apollo/discussions to ask it. -->
- [ ] I have checked the [discussions](https://github.com/ctripcorp/apollo/discussions)
- [ ] I have searched the [issues](https://github.com/ctripcorp/apollo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://www.apolloconfig.com/#/zh/faq/common-issues-in-deployment-and-development-phase) of this repository and believe that this is not a duplicate.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1.
2.
3.
4.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
### Additional Details & Logs
- Version
- Error logs
- Configuration
- Platform and Operating System
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./docs/zh/misc/apollo-benchmark.md | 很多同学关心Apollo的性能和可靠性,以下数据是采集携程内部生产环境单台机器的数据。监控工具是[Cat](https://github.com/dianping/cat)。
### 一、测试机器配置
#### 1.1 机器配置
4C12G
#### 1.2 JVM参数
````
-Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=8
-XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom
````
#### 1.3 JVM版本
1.8.0_60
#### 1.4 Apollo版本
0.9.0
#### 1.5 单台机器客户端连接数(客户端数)
5600
#### 1.6 集群总客户端连接数(客户端数)
10W+
### 二、性能指标
#### 2.1 获取配置Http接口响应时间
QPS: 160
平均响应时间: 0.1ms
95线响应时间: 0.3ms
999线响应时间: 2.5ms
>注:config service开启了配置缓存,更多信息可以参考[分布式部署指南中的缓存配置](zh/deployment/distributed-deployment-guide#_323-config-servicecacheenabled-是否开启配置缓存)
#### 2.2 Config Server GC情况
YGC: 平均2Min一次,一次耗时300ms
OGC: 平均1H一次,一次耗时380ms
#### 2.3 CPU指标
LoadAverage:0.5
System CPU利用率:6%
Process CPU利用率:8%
| 很多同学关心Apollo的性能和可靠性,以下数据是采集携程内部生产环境单台机器的数据。监控工具是[Cat](https://github.com/dianping/cat)。
### 一、测试机器配置
#### 1.1 机器配置
4C12G
#### 1.2 JVM参数
````
-Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=8
-XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom
````
#### 1.3 JVM版本
1.8.0_60
#### 1.4 Apollo版本
0.9.0
#### 1.5 单台机器客户端连接数(客户端数)
5600
#### 1.6 集群总客户端连接数(客户端数)
10W+
### 二、性能指标
#### 2.1 获取配置Http接口响应时间
QPS: 160
平均响应时间: 0.1ms
95线响应时间: 0.3ms
999线响应时间: 2.5ms
>注:config service开启了配置缓存,更多信息可以参考[分布式部署指南中的缓存配置](zh/deployment/distributed-deployment-guide#_323-config-servicecacheenabled-是否开启配置缓存)
#### 2.2 Config Server GC情况
YGC: 平均2Min一次,一次耗时300ms
OGC: 平均1H一次,一次耗时380ms
#### 2.3 CPU指标
LoadAverage:0.5
System CPU利用率:6%
Process CPU利用率:8%
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-demo/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-demo</artifactId>
<name>Apollo Demo</name>
<packaging>jar</packaging>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- for spring demo -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<!-- for spring boot demo -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- for refresh scope demo -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-demo</artifactId>
<name>Apollo Demo</name>
<packaging>jar</packaging>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- for spring demo -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<!-- for spring boot demo -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- for refresh scope demo -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-demo/src/main/resources/log4j2.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<configuration monitorInterval="60">
<appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[apollo-demo][%t]%d %-5p [%c] %m%n"/>
</Console>
<Async name="Async" includeLocation="true">
<AppenderRef ref="Console"/>
</Async>
</appenders>
<loggers>
<logger name="com.ctrip.framework.apollo" additivity="false" level="INFO">
<AppenderRef ref="Async"/>
</logger>
<logger name="com.ctrip.framework.apollo.demo" additivity="false" level="DEBUG">
<AppenderRef ref="Async"/>
</logger>
<root level="INFO">
<AppenderRef ref="Async"/>
</root>
</loggers>
</configuration>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<configuration monitorInterval="60">
<appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[apollo-demo][%t]%d %-5p [%c] %m%n"/>
</Console>
<Async name="Async" includeLocation="true">
<AppenderRef ref="Console"/>
</Async>
</appenders>
<loggers>
<logger name="com.ctrip.framework.apollo" additivity="false" level="INFO">
<AppenderRef ref="Async"/>
</logger>
<logger name="com.ctrip.framework.apollo.demo" additivity="false" level="DEBUG">
<AppenderRef ref="Async"/>
</logger>
<root level="INFO">
<AppenderRef ref="Async"/>
</root>
</loggers>
</configuration>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./docs/zh/usage/apollo-user-practices.md | Apollo 配置中心的实践案例,供大家参考:
* [Apollo+ES源码改造,构建民生银行的ELK日志平台配置管理中心](https://mp.weixin.qq.com/s/VHugn0vgNu4m56V49geC4w)
* [Apollo在有赞的实践](https://mp.weixin.qq.com/s/Ge14UeY9Gm2Hrk--E47eJQ)
* [微服务版本切换初始设计思路](https://blog.llyweb.com/articles/2020/08/11/1597149013480.html)
* [Alibaba Sentinel Push模式 规则推送至Apollo配置中心](https://anilople.github.io/Sentinel)
| Apollo 配置中心的实践案例,供大家参考:
* [Apollo+ES源码改造,构建民生银行的ELK日志平台配置管理中心](https://mp.weixin.qq.com/s/VHugn0vgNu4m56V49geC4w)
* [Apollo在有赞的实践](https://mp.weixin.qq.com/s/Ge14UeY9Gm2Hrk--E47eJQ)
* [微服务版本切换初始设计思路](https://blog.llyweb.com/articles/2020/08/11/1597149013480.html)
* [Alibaba Sentinel Push模式 规则推送至Apollo配置中心](https://anilople.github.io/Sentinel)
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./docs/zh/faq/common-issues-in-deployment-and-development-phase.md | ### 1. windows怎么执行build.sh?
安装[Git Bash](https://git-for-windows.github.io/),然后运行 “./build.sh” 注意前面 “./”
### 2. 本地运行时Portal一直报Env is down.
默认config service启动在8080端口,admin service启动在8090端口。请确认这两个端口是否被其它应用程序占用。
如果还伴有异常信息:org.springframework.web.client.HttpClientErrorException: 405 Method Not Allowed,一般是由于本地启动了`ShadowSocks`,因为`ShadowSocks`默认会占用8090端口。
1.1.0版本增加了**系统信息**页面,可以通过`管理员工具` -> `系统信息`查看当前各个环境的Meta Server以及admin service信息,有助于排查问题。
### 3. admin server 或者 config server 注册了内网IP,导致portal或者client访问不了admin server或config server
请参考[网络策略](zh/deployment/distributed-deployment-guide?id=_14-网络策略)。
### 4. Portal如何增加环境?
#### 4.1 1.6.0及以上的版本
1.6.0版本增加了自定义环境的功能,可以在不修改代码的情况增加环境
1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置)
2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。
>注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息)
> 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化
#### 4.2 1.5.1及之前的版本
##### 4.2.1 添加Apollo预先定义好的环境
如果需要添加的环境是Apollo预先定义的环境(DEV, FAT, UAT, PRO),需要两步操作:
1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置)
2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。
>注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息)
> 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化
##### 4.2.2 添加自定义的环境
如果需要添加的环境不是Apollo预先定义的环境,请参照如下步骤操作:
1. 假设需要添加的环境名称叫beta
2. 修改[com.ctrip.framework.apollo.core.enums.Env](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/Env.java)类,在其中加入`BETA`枚举:
```java
public enum Env{
LOCAL, DEV, BETA, FWS, FAT, UAT, LPT, PRO, TOOLS, UNKNOWN;
...
}
```
3. 修改[com.ctrip.framework.apollo.core.enums.EnvUtils](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/EnvUtils.java)类,在其中加入`BETA`枚举的转换逻辑:
```java
public final class EnvUtils {
public static Env transformEnv(String envName) {
if (StringUtils.isBlank(envName)) {
return Env.UNKNOWN;
}
switch (envName.trim().toUpperCase()) {
...
case "BETA":
return Env.BETA;
...
default:
return Env.UNKNOWN;
}
}
}
```
4. 修改[apollo-env.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/resources/apollo-env.properties),增加`beta.meta`占位符:
```properties
local.meta=http://localhost:8080
dev.meta=${dev_meta}
fat.meta=${fat_meta}
beta.meta=${beta_meta}
uat.meta=${uat_meta}
lpt.meta=${lpt_meta}
pro.meta=${pro_meta}
```
5. 修改[com.ctrip.framework.apollo.core.internals.LegacyMetaServerProvider](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/internals/LegacyMetaServerProvider.java)类,增加读取`BETA`环境的meta server地址逻辑:
```java
public class LegacyMetaServerProvider {
...
domains.put(Env.BETA, getMetaServerAddress(prop, "beta_meta", "beta.meta"));
...
}
```
6. protaldb增加`BETA`环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置)
7. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。
>注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息)
> 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化
### 5. 如何删除应用、集群、Namespace?
0.11.0版本开始Apollo管理员增加了删除应用、集群和AppNamespace的页面,建议使用该页面进行删除。
页面入口:

页面详情:

### 6. 客户端多块网卡造成获取IP不准,如何解决?
获取客户端网卡逻辑在1.4.0版本有所调整,所以需要根据客户端版本区分
#### 6.1 apollo-client为1.3.0及之前的版本
如果有多网卡,且都是普通网卡的话,需要在/etc/hosts里面加一条映射关系来提升权重。
格式:`ip ${hostname}`
这里的${hostname}就是你在机器上执行hostname的结果。
比如正确IP为:192.168.1.50,hostname执行结果为:jim-ubuntu-pc
那么最终在hosts文件映射的记录为:
```
192.168.1.50 jim-ubuntu-pc
```
#### 6.2 apollo-client为1.4.0及之后的版本
如果有多网卡,且都是普通网卡的话,可以通过调整它们在系统中的顺序来改变优先级,顺序在前的优先级更高。
### 7. 通过Apollo动态调整Spring Boot的Logging level
可以参考[apollo-use-cases](https://github.com/ctripcorp/apollo-use-cases)项目中的[spring-cloud-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-cloud-logger)和[spring-boot-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-boot-logger)代码示例。
### 8. 将Config Service和Admin Service注册到单独的Eureka Server上
Apollo默认自带了Eureka作为内部的注册中心实现,一般情况下不需要考虑为Apollo单独部署注册中心。
不过有些公司自己已经有了一套Eureka,如果希望把Apollo的Config Service和Admin Service也注册过去实现统一管理的话,可以按照如下步骤操作:
#### 1. 配置Config Service不启动内置Eureka Server
##### 1.1 1.5.0及以上版本
为apollo-configservice配置`apollo.eureka.server.enabled=false`即可,通过bootstrap.yml或-D参数等方式皆可。
##### 1.2 1.5.0之前的版本
修改[com.ctrip.framework.apollo.configservice.ConfigServiceApplication](https://github.com/ctripcorp/apollo/blob/master/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/ConfigServiceApplication.java),把`@EnableEurekaServer`改为`@EnableEurekaClient`
```java
@EnableEurekaClient
@EnableAspectJAutoProxy
@EnableAutoConfiguration // (exclude = EurekaClientConfigBean.class)
@Configuration
@EnableTransactionManagement
@PropertySource(value = {"classpath:configservice.properties"})
@ComponentScan(basePackageClasses = {ApolloCommonConfig.class,
ApolloBizConfig.class,
ConfigServiceApplication.class,
ApolloMetaServiceConfig.class})
public class ConfigServiceApplication {
...
}
```
#### 2. 修改ApolloConfigDB.ServerConfig表中的`eureka.service.url`,指向自己的Eureka地址
比如自己的Eureka服务地址是1.1.1.1:8761和2.2.2.2:8761,那么就将ApolloConfigDB.ServerConfig表中设置eureka.service.url为:
```
http://1.1.1.1:8761/eureka/,http://2.2.2.2:8761/eureka/
```
需要注意的是更改Eureka地址只需要改ApolloConfigDB.ServerConfig表中的`eureka.service.url`即可,不需要修改meta server地址。
> 默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址,修改Eureka地址时不需要修改meta server地址。
### 9. Spring Boot中使用`ConditionalOnProperty`读取不到配置
`@ConditionalOnProperty`功能从0.10.0版本开始支持,具体可以参考 [Spring Boot集成方式](zh/usage/java-sdk-user-guide?id=_3213-spring-boot集成方式(推荐))
### 10. 多机房如何实现A机房的客户端就近读取A机房的config service,B机房的客户端就近读取B机房的config service?
请参考[Issue 1294](https://github.com/ctripcorp/apollo/issues/1294),该案例中由于中美机房相距甚远,所以需要config db两地部署,如果是同城多机房的话,两个机房的config service可以连同一个config db。
### 11. apollo是否有支持HEAD请求的页面?阿里云slb配置健康检查只支持HEAD请求
apollo的每个服务都有`/health`页面的,该页面是apollo用来做健康检测的,支持各种请求方法,如GET, POST, HEAD等。
### 12. apollo如何配置查看权限?
从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。
这里的项目成员是指:
1. 项目的管理员
2. 具备该私有Namespace在该环境下的修改或发布权限
配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。

### 13. apollo如何放在独立的tomcat中跑?
有些公司的运维策略可能会要求必须使用独立的tomcat跑应用,不允许apollo默认的startup.sh方式运行,下面以apollo-configservice为例简述一下如何使apollo服务端运行在独立的tomcat中:
1. 获取apollo代码(生产部署建议用release的版本)
2. 修改apollo-configservice的pom.xml,增加`<packaging>war</packaging>`
3. 按照分布式部署文档配置build.sh,然后打包
4. 把apollo-configservice的war包放到tomcat下
* cp apollo-configservice/target/apollo-configservice-xxx.war ${tomcat-dir}/webapps/ROOT.war
运行tomcat的startup.sh
5. 运行tomcat的startup.sh
另外,apollo还有一些调优参数建议在tomcat的server.xml中配置一下,可以参考[application.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-common/src/main/resources/application.properties#L12)
### 14. 注册中心Eureka如何替换为zookeeper?
许多公司微服务项目已经在使用zookeeper,如果出于方便服务管理的目的,希望Eureka替换为zookeeper的情况,可以参考[@hanyidreamer](https://github.com/hanyidreamer)贡献的改造步骤:[注册中心Eureka替换为zookeeper](https://blog.csdn.net/u014732209/article/details/89555535)
### 15. 本地多人同时开发,如何实现配置不一样且互不影响?
参考[#1560](https://github.com/ctripcorp/apollo/issues/1560)
### 16. Portal挂载到nginx/slb后如何设置相对路径?
一般情况下建议直接使用根目录来挂载portal,不过如果有些情况希望和其它应用共用nginx/slb,需要加上相对路径(如/apollo),那么可以按照下面的方式配置。
#### 16.1 Portal为1.7.0及以上版本
首先为apollo-portal增加-D参数`server.servlet.context-path=/apollo`或系统环境变量`SERVER_SERVLET_CONTEXT_PATH=/apollo`。
然后在nginx/slb上配置转发即可,以nginx为例:
```
location /apollo/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8070/apollo/;
}
```
#### 16.2 Portal为1.6.0及以上版本
首先为portal加上`prefix.path=/apollo`配置参数,配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`prefix.path`配置项即可。
然后在nginx/slb上配置转发即可,以nginx为例:
```
location /apollo/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8070/;
}
``` | ### 1. windows怎么执行build.sh?
安装[Git Bash](https://git-for-windows.github.io/),然后运行 “./build.sh” 注意前面 “./”
### 2. 本地运行时Portal一直报Env is down.
默认config service启动在8080端口,admin service启动在8090端口。请确认这两个端口是否被其它应用程序占用。
如果还伴有异常信息:org.springframework.web.client.HttpClientErrorException: 405 Method Not Allowed,一般是由于本地启动了`ShadowSocks`,因为`ShadowSocks`默认会占用8090端口。
1.1.0版本增加了**系统信息**页面,可以通过`管理员工具` -> `系统信息`查看当前各个环境的Meta Server以及admin service信息,有助于排查问题。
### 3. admin server 或者 config server 注册了内网IP,导致portal或者client访问不了admin server或config server
请参考[网络策略](zh/deployment/distributed-deployment-guide?id=_14-网络策略)。
### 4. Portal如何增加环境?
#### 4.1 1.6.0及以上的版本
1.6.0版本增加了自定义环境的功能,可以在不修改代码的情况增加环境
1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置)
2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。
>注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息)
> 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化
#### 4.2 1.5.1及之前的版本
##### 4.2.1 添加Apollo预先定义好的环境
如果需要添加的环境是Apollo预先定义的环境(DEV, FAT, UAT, PRO),需要两步操作:
1. protaldb增加环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置)
2. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。
>注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息)
> 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化
##### 4.2.2 添加自定义的环境
如果需要添加的环境不是Apollo预先定义的环境,请参照如下步骤操作:
1. 假设需要添加的环境名称叫beta
2. 修改[com.ctrip.framework.apollo.core.enums.Env](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/Env.java)类,在其中加入`BETA`枚举:
```java
public enum Env{
LOCAL, DEV, BETA, FWS, FAT, UAT, LPT, PRO, TOOLS, UNKNOWN;
...
}
```
3. 修改[com.ctrip.framework.apollo.core.enums.EnvUtils](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/enums/EnvUtils.java)类,在其中加入`BETA`枚举的转换逻辑:
```java
public final class EnvUtils {
public static Env transformEnv(String envName) {
if (StringUtils.isBlank(envName)) {
return Env.UNKNOWN;
}
switch (envName.trim().toUpperCase()) {
...
case "BETA":
return Env.BETA;
...
default:
return Env.UNKNOWN;
}
}
}
```
4. 修改[apollo-env.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-portal/src/main/resources/apollo-env.properties),增加`beta.meta`占位符:
```properties
local.meta=http://localhost:8080
dev.meta=${dev_meta}
fat.meta=${fat_meta}
beta.meta=${beta_meta}
uat.meta=${uat_meta}
lpt.meta=${lpt_meta}
pro.meta=${pro_meta}
```
5. 修改[com.ctrip.framework.apollo.core.internals.LegacyMetaServerProvider](https://github.com/ctripcorp/apollo/blob/master/apollo-core/src/main/java/com/ctrip/framework/apollo/core/internals/LegacyMetaServerProvider.java)类,增加读取`BETA`环境的meta server地址逻辑:
```java
public class LegacyMetaServerProvider {
...
domains.put(Env.BETA, getMetaServerAddress(prop, "beta_meta", "beta.meta"));
...
}
```
6. protaldb增加`BETA`环境,参考[3.1 调整ApolloPortalDB配置](zh/deployment/distributed-deployment-guide?id=_31-调整apolloportaldb配置)
7. 为apollo-portal添加新增环境对应的meta server地址,具体参考:[2.2.1.1.2.4 配置apollo-portal的meta service信息](zh/deployment/distributed-deployment-guide?id=_221124-配置apollo-portal的meta-service信息)。apollo-client在新的环境下使用时也需要做好相应的配置,具体参考:[1.2.2 Apollo Meta Server](zh/usage/java-sdk-user-guide?id=_122-apollo-meta-server)。
>注1:一套Portal可以管理多个环境,但是每个环境都需要独立部署一套Config Service、Admin Service和ApolloConfigDB,具体请参考:[2.1.2 创建ApolloConfigDB](zh/deployment/distributed-deployment-guide?id=_212-创建apolloconfigdb),[3.2 调整ApolloConfigDB配置](zh/deployment/distributed-deployment-guide?id=_32-调整apolloconfigdb配置),[2.2.1.1.2 配置数据库连接信息](zh/deployment/distributed-deployment-guide?id=_22112-配置数据库连接信息)
> 注2:如果是为已经运行了一段时间的Apollo配置中心增加环境,别忘了参考[2.1.2.4 从别的环境导入ApolloConfigDB的项目数据](zh/deployment/distributed-deployment-guide?id=_2124-从别的环境导入apolloconfigdb的项目数据)对新的环境做初始化
### 5. 如何删除应用、集群、Namespace?
0.11.0版本开始Apollo管理员增加了删除应用、集群和AppNamespace的页面,建议使用该页面进行删除。
页面入口:

页面详情:

### 6. 客户端多块网卡造成获取IP不准,如何解决?
获取客户端网卡逻辑在1.4.0版本有所调整,所以需要根据客户端版本区分
#### 6.1 apollo-client为1.3.0及之前的版本
如果有多网卡,且都是普通网卡的话,需要在/etc/hosts里面加一条映射关系来提升权重。
格式:`ip ${hostname}`
这里的${hostname}就是你在机器上执行hostname的结果。
比如正确IP为:192.168.1.50,hostname执行结果为:jim-ubuntu-pc
那么最终在hosts文件映射的记录为:
```
192.168.1.50 jim-ubuntu-pc
```
#### 6.2 apollo-client为1.4.0及之后的版本
如果有多网卡,且都是普通网卡的话,可以通过调整它们在系统中的顺序来改变优先级,顺序在前的优先级更高。
### 7. 通过Apollo动态调整Spring Boot的Logging level
可以参考[apollo-use-cases](https://github.com/ctripcorp/apollo-use-cases)项目中的[spring-cloud-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-cloud-logger)和[spring-boot-logger](https://github.com/ctripcorp/apollo-use-cases/tree/master/spring-boot-logger)代码示例。
### 8. 将Config Service和Admin Service注册到单独的Eureka Server上
Apollo默认自带了Eureka作为内部的注册中心实现,一般情况下不需要考虑为Apollo单独部署注册中心。
不过有些公司自己已经有了一套Eureka,如果希望把Apollo的Config Service和Admin Service也注册过去实现统一管理的话,可以按照如下步骤操作:
#### 1. 配置Config Service不启动内置Eureka Server
##### 1.1 1.5.0及以上版本
为apollo-configservice配置`apollo.eureka.server.enabled=false`即可,通过bootstrap.yml或-D参数等方式皆可。
##### 1.2 1.5.0之前的版本
修改[com.ctrip.framework.apollo.configservice.ConfigServiceApplication](https://github.com/ctripcorp/apollo/blob/master/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/ConfigServiceApplication.java),把`@EnableEurekaServer`改为`@EnableEurekaClient`
```java
@EnableEurekaClient
@EnableAspectJAutoProxy
@EnableAutoConfiguration // (exclude = EurekaClientConfigBean.class)
@Configuration
@EnableTransactionManagement
@PropertySource(value = {"classpath:configservice.properties"})
@ComponentScan(basePackageClasses = {ApolloCommonConfig.class,
ApolloBizConfig.class,
ConfigServiceApplication.class,
ApolloMetaServiceConfig.class})
public class ConfigServiceApplication {
...
}
```
#### 2. 修改ApolloConfigDB.ServerConfig表中的`eureka.service.url`,指向自己的Eureka地址
比如自己的Eureka服务地址是1.1.1.1:8761和2.2.2.2:8761,那么就将ApolloConfigDB.ServerConfig表中设置eureka.service.url为:
```
http://1.1.1.1:8761/eureka/,http://2.2.2.2:8761/eureka/
```
需要注意的是更改Eureka地址只需要改ApolloConfigDB.ServerConfig表中的`eureka.service.url`即可,不需要修改meta server地址。
> 默认情况下,meta service和config service是部署在同一个JVM进程,所以meta service的地址就是config service的地址,修改Eureka地址时不需要修改meta server地址。
### 9. Spring Boot中使用`ConditionalOnProperty`读取不到配置
`@ConditionalOnProperty`功能从0.10.0版本开始支持,具体可以参考 [Spring Boot集成方式](zh/usage/java-sdk-user-guide?id=_3213-spring-boot集成方式(推荐))
### 10. 多机房如何实现A机房的客户端就近读取A机房的config service,B机房的客户端就近读取B机房的config service?
请参考[Issue 1294](https://github.com/ctripcorp/apollo/issues/1294),该案例中由于中美机房相距甚远,所以需要config db两地部署,如果是同城多机房的话,两个机房的config service可以连同一个config db。
### 11. apollo是否有支持HEAD请求的页面?阿里云slb配置健康检查只支持HEAD请求
apollo的每个服务都有`/health`页面的,该页面是apollo用来做健康检测的,支持各种请求方法,如GET, POST, HEAD等。
### 12. apollo如何配置查看权限?
从1.1.0版本开始,apollo-portal增加了查看权限的支持,可以支持配置某个环境只允许项目成员查看私有Namespace的配置。
这里的项目成员是指:
1. 项目的管理员
2. 具备该私有Namespace在该环境下的修改或发布权限
配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`configView.memberOnly.envs`配置项即可。

### 13. apollo如何放在独立的tomcat中跑?
有些公司的运维策略可能会要求必须使用独立的tomcat跑应用,不允许apollo默认的startup.sh方式运行,下面以apollo-configservice为例简述一下如何使apollo服务端运行在独立的tomcat中:
1. 获取apollo代码(生产部署建议用release的版本)
2. 修改apollo-configservice的pom.xml,增加`<packaging>war</packaging>`
3. 按照分布式部署文档配置build.sh,然后打包
4. 把apollo-configservice的war包放到tomcat下
* cp apollo-configservice/target/apollo-configservice-xxx.war ${tomcat-dir}/webapps/ROOT.war
运行tomcat的startup.sh
5. 运行tomcat的startup.sh
另外,apollo还有一些调优参数建议在tomcat的server.xml中配置一下,可以参考[application.properties](https://github.com/ctripcorp/apollo/blob/master/apollo-common/src/main/resources/application.properties#L12)
### 14. 注册中心Eureka如何替换为zookeeper?
许多公司微服务项目已经在使用zookeeper,如果出于方便服务管理的目的,希望Eureka替换为zookeeper的情况,可以参考[@hanyidreamer](https://github.com/hanyidreamer)贡献的改造步骤:[注册中心Eureka替换为zookeeper](https://blog.csdn.net/u014732209/article/details/89555535)
### 15. 本地多人同时开发,如何实现配置不一样且互不影响?
参考[#1560](https://github.com/ctripcorp/apollo/issues/1560)
### 16. Portal挂载到nginx/slb后如何设置相对路径?
一般情况下建议直接使用根目录来挂载portal,不过如果有些情况希望和其它应用共用nginx/slb,需要加上相对路径(如/apollo),那么可以按照下面的方式配置。
#### 16.1 Portal为1.7.0及以上版本
首先为apollo-portal增加-D参数`server.servlet.context-path=/apollo`或系统环境变量`SERVER_SERVLET_CONTEXT_PATH=/apollo`。
然后在nginx/slb上配置转发即可,以nginx为例:
```
location /apollo/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8070/apollo/;
}
```
#### 16.2 Portal为1.6.0及以上版本
首先为portal加上`prefix.path=/apollo`配置参数,配置方式很简单,用超级管理员账号登录后,进入`管理员工具 - 系统参数`页面新增或修改`prefix.path`配置项即可。
然后在nginx/slb上配置转发即可,以nginx为例:
```
location /apollo/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8070/;
}
``` | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-biz/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId>
<name>Apollo Biz</name>
<packaging>jar</packaging>
<properties>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-common</artifactId>
</dependency>
<!-- eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId>
<name>Apollo Biz</name>
<packaging>jar</packaging>
<properties>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-common</artifactId>
</dependency>
<!-- eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-adminservice/src/main/resources/logback.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<property name="LOG_FILE"
value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}apollo-adminservice.log}" />
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<root level="INFO">
<if condition='isDefined("LOG_APPENDERS")'>
<then>
<if condition='property("LOG_APPENDERS").contains("CONSOLE")'>
<then>
<appender-ref ref="CONSOLE"/>
</then>
</if>
<if condition='property("LOG_APPENDERS").contains("FILE")'>
<then>
<appender-ref ref="FILE"/>
</then>
</if>
</then>
<else>
<appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</else>
</if>
</root>
</configuration>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<property name="LOG_FILE"
value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}apollo-adminservice.log}" />
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<root level="INFO">
<if condition='isDefined("LOG_APPENDERS")'>
<then>
<if condition='property("LOG_APPENDERS").contains("CONSOLE")'>
<then>
<appender-ref ref="CONSOLE"/>
</then>
</if>
<if condition='property("LOG_APPENDERS").contains("FILE")'>
<then>
<appender-ref ref="FILE"/>
</then>
</if>
</then>
<else>
<appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</else>
</if>
</root>
</configuration>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./docs/zh/development/portal-how-to-enable-webhook-notification.md | 从 1.8.0 版本开始,apollo 增加了 webhook 支持,从而可以在配置发布时触发 webhook 并告知配置发布的信息。
## 启用方式
> 配置项统一存储在ApolloPortalDB.ServerConfig表中,也可以通过`管理员工具 - 系统参数`页面进行配置,修改完一分钟实时生效。
1. webhook.supported.envs
开启 webhook 的环境列表,多个环境以英文逗号分隔,如
```
DEV,FAT,UAT,PRO
```
2. config.release.webhook.service.url
webhook 通知的 url 地址,需要接收 HTTP POST 请求。如有多个地址,以英文逗号分隔,如
```
http://www.xxx.com/webhook1,http://www.xxx.com/webhook2
```
## Webhook 接入方式
1. URL 参数
参数名 | 参数说明
--- | ---
env | 该次配置发布所在的环境
2. Request body sample
```json
{
"appId": "", // appId
"clusterName": "", // 集群
"namespaceName": "", // namespace
"operator": "", // 发布人
"releaseId": 2, // releaseId
"releaseTitle": "", // releaseTitle
"releaseComment": "", // releaseComment
"releaseTime": "", // 发布时间 eg:2020-01-01T00:00:00.000+0800
"configuration": [ { // 发布后的全部配置,如果为灰度发布,则为灰度发布后的全部配置
"firstEntity": "", // 配置的key
"secondEntity": "" // 配置的value
} ],
"isReleaseAbandoned": false,
"previousReleaseId": 1, // 上一次正式发布的releaseId
"operation": // 0-正常发布 1-配置回滚 2-灰度发布 4-全量发布
"operationContext": { // 操作设置的属性配置
"isEmergencyPublish": true/false, // 是否紧急发布
"rules": [ { // 灰度规则
"clientAppId": "", // appId
"clientIpList": [ "10.0.0.2", "10.0.0.3" ] // IP列表
} ],
"branchReleaseKeys": [ "", "" ] // 灰度发布的key
}
}
``` | 从 1.8.0 版本开始,apollo 增加了 webhook 支持,从而可以在配置发布时触发 webhook 并告知配置发布的信息。
## 启用方式
> 配置项统一存储在ApolloPortalDB.ServerConfig表中,也可以通过`管理员工具 - 系统参数`页面进行配置,修改完一分钟实时生效。
1. webhook.supported.envs
开启 webhook 的环境列表,多个环境以英文逗号分隔,如
```
DEV,FAT,UAT,PRO
```
2. config.release.webhook.service.url
webhook 通知的 url 地址,需要接收 HTTP POST 请求。如有多个地址,以英文逗号分隔,如
```
http://www.xxx.com/webhook1,http://www.xxx.com/webhook2
```
## Webhook 接入方式
1. URL 参数
参数名 | 参数说明
--- | ---
env | 该次配置发布所在的环境
2. Request body sample
```json
{
"appId": "", // appId
"clusterName": "", // 集群
"namespaceName": "", // namespace
"operator": "", // 发布人
"releaseId": 2, // releaseId
"releaseTitle": "", // releaseTitle
"releaseComment": "", // releaseComment
"releaseTime": "", // 发布时间 eg:2020-01-01T00:00:00.000+0800
"configuration": [ { // 发布后的全部配置,如果为灰度发布,则为灰度发布后的全部配置
"firstEntity": "", // 配置的key
"secondEntity": "" // 配置的value
} ],
"isReleaseAbandoned": false,
"previousReleaseId": 1, // 上一次正式发布的releaseId
"operation": // 0-正常发布 1-配置回滚 2-灰度发布 4-全量发布
"operationContext": { // 操作设置的属性配置
"isEmergencyPublish": true/false, // 是否紧急发布
"rules": [ { // 灰度规则
"clientAppId": "", // appId
"clientIpList": [ "10.0.0.2", "10.0.0.3" ] // IP列表
} ],
"branchReleaseKeys": [ "", "" ] // 灰度发布的key
}
}
``` | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/service/AdminServiceTransactionTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.biz.service;
import com.ctrip.framework.apollo.biz.AbstractIntegrationTest;
import com.ctrip.framework.apollo.biz.repository.AppNamespaceRepository;
import com.ctrip.framework.apollo.biz.repository.AppRepository;
import com.ctrip.framework.apollo.biz.repository.ClusterRepository;
import com.ctrip.framework.apollo.biz.repository.NamespaceRepository;
import com.ctrip.framework.apollo.common.entity.App;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.transaction.AfterTransaction;
import org.springframework.test.context.transaction.BeforeTransaction;
import java.util.Date;
public class AdminServiceTransactionTest extends AbstractIntegrationTest {
@Autowired
AdminService adminService;
@Autowired
private AppRepository appRepository;
@Autowired
private AppNamespaceRepository appNamespaceRepository;
@Autowired
private NamespaceRepository namespaceRepository;
@Autowired
private ClusterRepository clusterRepository;
@BeforeTransaction
public void verifyInitialDatabaseState() {
for (App app : appRepository.findAll()) {
System.out.println(app.getAppId());
}
Assert.assertEquals(0, appRepository.count());
Assert.assertEquals(7, appNamespaceRepository.count());
Assert.assertEquals(0, namespaceRepository.count());
Assert.assertEquals(0, clusterRepository.count());
}
@Before
public void setUpTestDataWithinTransaction() {
Assert.assertEquals(0, appRepository.count());
Assert.assertEquals(7, appNamespaceRepository.count());
Assert.assertEquals(0, namespaceRepository.count());
Assert.assertEquals(0, clusterRepository.count());
}
@Test
@Rollback
public void modifyDatabaseWithinTransaction() {
String appId = "someAppId";
App app = new App();
app.setAppId(appId);
app.setName("someAppName");
String owner = "someOwnerName";
app.setOwnerName(owner);
app.setOwnerEmail("someOwnerName@ctrip.com");
app.setDataChangeCreatedBy(owner);
app.setDataChangeLastModifiedBy(owner);
app.setDataChangeCreatedTime(new Date());
adminService.createNewApp(app);
}
@After
public void tearDownWithinTransaction() {
Assert.assertEquals(1, appRepository.count());
Assert.assertEquals(8, appNamespaceRepository.count());
Assert.assertEquals(1, namespaceRepository.count());
Assert.assertEquals(1, clusterRepository.count());
}
@AfterTransaction
public void verifyFinalDatabaseState() {
Assert.assertEquals(0, appRepository.count());
Assert.assertEquals(7, appNamespaceRepository.count());
Assert.assertEquals(0, namespaceRepository.count());
Assert.assertEquals(0, clusterRepository.count());
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.biz.service;
import com.ctrip.framework.apollo.biz.AbstractIntegrationTest;
import com.ctrip.framework.apollo.biz.repository.AppNamespaceRepository;
import com.ctrip.framework.apollo.biz.repository.AppRepository;
import com.ctrip.framework.apollo.biz.repository.ClusterRepository;
import com.ctrip.framework.apollo.biz.repository.NamespaceRepository;
import com.ctrip.framework.apollo.common.entity.App;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.transaction.AfterTransaction;
import org.springframework.test.context.transaction.BeforeTransaction;
import java.util.Date;
public class AdminServiceTransactionTest extends AbstractIntegrationTest {
@Autowired
AdminService adminService;
@Autowired
private AppRepository appRepository;
@Autowired
private AppNamespaceRepository appNamespaceRepository;
@Autowired
private NamespaceRepository namespaceRepository;
@Autowired
private ClusterRepository clusterRepository;
@BeforeTransaction
public void verifyInitialDatabaseState() {
for (App app : appRepository.findAll()) {
System.out.println(app.getAppId());
}
Assert.assertEquals(0, appRepository.count());
Assert.assertEquals(7, appNamespaceRepository.count());
Assert.assertEquals(0, namespaceRepository.count());
Assert.assertEquals(0, clusterRepository.count());
}
@Before
public void setUpTestDataWithinTransaction() {
Assert.assertEquals(0, appRepository.count());
Assert.assertEquals(7, appNamespaceRepository.count());
Assert.assertEquals(0, namespaceRepository.count());
Assert.assertEquals(0, clusterRepository.count());
}
@Test
@Rollback
public void modifyDatabaseWithinTransaction() {
String appId = "someAppId";
App app = new App();
app.setAppId(appId);
app.setName("someAppName");
String owner = "someOwnerName";
app.setOwnerName(owner);
app.setOwnerEmail("someOwnerName@ctrip.com");
app.setDataChangeCreatedBy(owner);
app.setDataChangeLastModifiedBy(owner);
app.setDataChangeCreatedTime(new Date());
adminService.createNewApp(app);
}
@After
public void tearDownWithinTransaction() {
Assert.assertEquals(1, appRepository.count());
Assert.assertEquals(8, appNamespaceRepository.count());
Assert.assertEquals(1, namespaceRepository.count());
Assert.assertEquals(1, clusterRepository.count());
}
@AfterTransaction
public void verifyFinalDatabaseState() {
Assert.assertEquals(0, appRepository.count());
Assert.assertEquals(7, appNamespaceRepository.count());
Assert.assertEquals(0, namespaceRepository.count());
Assert.assertEquals(0, clusterRepository.count());
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./doc/images/apollo-client-maven-artifacts.png | PNG
IHDR I z gAMA |Q cHRM T + }> : iCCPICC Profile Xíw\SBBD@JM^t H*vtQZ.lI]{3w9̙ߙ;f EkV^^6@@LLJf t#-
,nD^[Qpl (ȩ!; puv B'.dU sŜ*Ih_^ , nf!;Qksx|Ր=,'BV$C6M.N?bdYx¼l\.9٢1af9y
3q~jD$dxfdl/3 asX~ 3DYq2e $}?+q 7Z-gGq
W3Wz(#6A(G@V-̊ }X1#E5B~&`9±0+6K2\WAFl/&ip0'ӆ-[%jفy
c^-L:أLVHlwyQRm8
/L 5Llw @:KeG^c@HrA!J MrP#<k^θX?بD1@4a k-)pKI,^Lza Yv0nU;>;\X0o +k6?'V}>2LE1wsām菞
0v;]Ďc̀ZN섘WJ-Z-X7ZXall|| s
/on\/=
\f0m5ikm.taH7[~ .И2 S ^lPjc(·B `
x"A,H3gy6PւMl;A=fpe
n{p]`#BG4]@lgGh$ IA>"B#K2d=R@_ci"҃A5 P*jdFCXtE2t5Z֢{&4z/a`,1gĒ4L-Jrۏ|
8L <gB|^Mx~
ÇA`Ap% لB9a7(,|o D"hBte18xF!>&H$
ɝIb
H%-S~<YlK 'br9y$*yDNIHU.R#7Wn.V+rr#e ŝKɤ,TPSRS˻O/?(AO#UjNNu6fL%
hi
3
t+`"*&
/g*)+V8$dRZTtLҰ2]F9R9GyUH***e*;UΨ<ct/M_JE?KW%fSRRSQWWVvB1l!MƧ 'p' '{sKPXѬ@4ל9[FDՉnK'xW2֚SSkX[G;P;O{ANF:t]]FS2lf9'ۡץ7o_@ `Aa|FûFrFFF761N0^nlD$ؤȤ)4ߴ,lY9j`a^e~pYlD2?v-Keee*̪تdɓM>?u.{6*6!666mmٶUhvvZ^[sko;;;|qtr8wp2tJqveq\vtr|]S뻳wz0=R<{zy<k=yxqv{=6Gs罯6?/Яԯ_?οa~@z@cPC BPhк[!ИGaap4<$|C~Ds$ $*?귩ĩQS>}>3+fO̻X5LDq'%OM rf/%;yxM;L/~sɌ93.Ԝ=,YYS) ){R>"Y!/{3Nj3u>KsO[<=}C@gFy ϗW{-}VdV]hvBrNJ1
?ߑ;''"$75S T[g[
T6Sd*IWQXUavst5r__2o,Zq%%YK~/.^_vie/{SO%
%[ݖo[ZirʯKeeeWW]犟GWZ㸦f-q-u+/ZxC̍nb}͔͢ͽa-[2FOՁjr^ٿM{[ٶOyoTk\[p]Knez;hYӈ6N۽o_~;0E5כBv>ёMHܦޖc![Zf[qU'N9I9詢SmymO?n~LS;Άp.ܙO]ppc/5_vywߏv9v5]q3Uϫ];w=7znݼ}kۜdyuȽ K(=(?:|cOO>/{J{ZLYsg#%)U呿J%x5z7uo߶G
?|n}?Ϥ_̾~
z4gt4%`IhZ %C7 KRyQB|&) sWb V#T؊ޱ^ "LƢm H |l@['.Dn&NʿWl˔ pHYs + YiTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
<tiff:Orientation>1</tiff:Orientation>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
L'Y <IDATx^|TU)^ `h D:P%.]kwD@DB@PzD ` 2d;;;%~惙|{S}"D"@ D"Ь 7kIx"@ D"@ *"@ D"@@ @nhF D"@ DK:@ D"@ - 9-D"@ D"@. D"@ DඈfJ"@ D"@ 9D"@ D"""*A D"@ nAa MJ=}NԸy|T*؉@3k7xp7ڶ;cb'(
"N˰Tl| ͚S\U1f&ܡ߯}I1 n:Bp`8<=}-jP 2U'[&N02Ą襨:@Xmg-~Rx؇>D/44IX&)x#s27"BgeGح0;f4bNcҖ(~qC¯ʱHi:;8+Ϙxt-J]M;W+Ϋ~>3A~F/qڭʈ"[f3&'"7(-akX0+1 9~=1
<<ޮP?y܋uP$pKئv_1E.QAs(k܊բF[C]m-t.]D×Sm?$
stNG#]!Hdέ'WG [1=a݅7}7eH 7D] ڢUҸyEBV8w_8yu?bmOts
FDr.W4I]:8/ yWQV+.$5>{c[bZr4-]U?gRHg(YS_"iYO;$z-ڻm\1?)rs2#[>JUi:I&nOa@xy{?ᦪ16g>_](9Oʀ",Nqpð
u*of;~&՜ٽOayX~|"{gGOg@W(:zXR?IºMYgƖ}PGIVh5Djz5(k)H
OnGd$_lK&/UxOdXAe0!ἓy</?$'q %w6T>t8T;1|nԚ7V|\~E͈@K׳^?gA72sT/."jE*>w+-O>PVqZ%84 ÃLzog&?s6
G{).ޏ1?KxGT',A+*;>u~8h{?34NJt
2r<^]h<*Qv8ùts9eI.}u=:S:G?墲:[^1c_p~
q9mDߍ Ք$'\:2.5p%m4C^WjMocQXMg*1smH9\з}.&Rn_ZQ";̤߫
)CuY
&Ee<>MB6h7P?BR8]?%"ݍvHdUo8-H%\و<V@IWVN]gRϰp1/av=Ct{wW}7[xhvJ##%<Q}QJ<0<{,ERŘVJNz-QF),PNnfz}&
XOģ(ʷNcQ-K-^X3bQqy;yGr~od4(*C}<F"@\up:GDz)re48V^j>uY2.aicV/?DulMM1\<sv%O,/y~۟3CD1-Xk3зG.Jb"wv˿E?I
K`4~9]acRc"I](6o5^s6 زf>"}#?ajgUKm5 ?wܯI,D?+N ?xM)?{Bds2ޣ)ٍVǗ%C-W_;gJV53"<
QE,_
122|rv旡O~'8pǭyƌ?Gco12b^!`JrXa<gΡvt3`2^>0
bEkƴr*ǠůܩlE{㊋uƹ;O 1+1J}Yj}D$%m[]F8ϪɸĹ
EDD=ܢ
WltYRBȤ:tw=ՖB]-t;ZTK0k?7o=S^ۺZh<Qc\o4tMHۺl^yr
{!ǟ
&;VˎZ*>QXtՆ(HulfEhF-Ksiװ(qV߹/VZ?N䴟&16-<mY<%4ejTqIzq`p͝BpnX[Ga
*
a08R?EntW^Tԩ5Ɠ}`G\VD)UlbDCQ2A,0iLe*n?Kn ={LD]tsפ#3X
<-='}O|#rnq~wueҘˑ~6b8;g;zDLLGwkJ3έ:_~%vho*"spMV#=j<~[o0ܵygỳíƜqw3^w^Ҭ~6f\xE'
g,9}KpY{Ճu}/|3$%>3U,<:57}*?2rv6aH|y| v0K>MP[vFaؔY֕oE\k"aLN$TCڶ}LR7|,JvuѴ~Ik|B5Լ}T/@2.aT=syS'&2UiaA-bӪHz?]=qc9yCHkwzmR0Rx֡F%s*brlB
)(lڣ;"{=6O>z[%z&̽N=
6g^G_fY(IqYr<KB<#Y苭+Y^/Yh
93~t{fٹʳн{~!|oxG0e](% Dsp+*.kpٛV2c˔> 7Y378m&t5rzdsW~=lJ^X2(|´_u/J9,aFhZT*7)}9g"-;gpG[e_Ggׅta}3ښ[riqul'v?}+ð=/xbMt߉?+Yml,O6qf95fw-ZymXg}}_J d Y_<i1T%9~6苹IkefJYb%u
z: n8h54.RC'sL
KꙒ&۟jtUtbDDbr.CoGA1>6JK1t6qv[gOk8}Q~rJk%yێ74GbHmw
}Ў5TU H~<.5~r (% ۇ /?]ƃF؞~c0a
OeC喭u6e՞o8s).|Vߑj:{T%s~IҌ7~sRMjGuɯUue[#jcy5o#0ǘ$3皐gt]MޏSf%=c[60j4
O<uwwP{ٚ[nR~\ǿyL]Yv%oZ%Uϸ^_6Z/'PR@5ŕP|ivk>6)U_2ڎW1O)\HͅoLLLIٮf<"Yc^lj+yyûMCp(]Lο(ɹ$ @?>el;8.b{饐=d*
3R`p9>+7UWČ܊=
ж4q`ϖxfJtDELf%\(27qF_
+8~nnauǣ3}%s~'Ovzѽr%7
-#ԹWhb|KobÖ%"C*<0ߤsXf9V4=&W`_E5F&dAN|Y}L/>HJrvYdPWV*A={yE|UPZtӦ|y:wg*TyWDgkLa)q^d虛*%9?7R)ؑ5N@]FolJ\iy'J3-j`FR=SDuoۇVpnW-N:~+/)Tڿyƅ4qx}2/JϤnڞh=iرGګ[!
WY٥,wY,s?yHٳ
RxIDF
740V?WWNY-9oE91H\g6)~vX#VsaK-aQ|5|u$9mH,EZT/+Wڛ("{YͿ
+jS{m[<r>;ick0&Q6[^Ð~D)'_݃&A^f#{"f[yt :5(?XgOAKINKmR6W/.ƃ@\Vr3%ff-1w2
7B^ہ tO[>[Yw Ǭ[O'Ty$Uq=+JqOX(8!@?ڞN{VnDžzA
?aǺbB}Tʁ"l&rq8rU|+Vo{9%g8"bALaI*%4Xq`=⯤GYrA1ViQs
6c7}gJC?_ёAb$KY6~N|e~
m/Ka좓 -Mp٣~JV,3{"rIᘇH=,kz/&͉PE
8U?%mi$ۭ``ry:6>}kYz,?Ychq5cd1&r"k }O[ڤ6/Yx^|ówrdnzRBY)o*}(V*tP,sX2s_Z=/O]mc}a7U֔F }8~lD ֤/H&dC-,kobGw4 Xq}6QpÀK^%}\=skYʽ(IJR
2{dkKc:Y6&rOKQكlc/!y _8-GOq!}'K<ɟ$!ីQ-g[)(NBhc"rnS'\fKv+*3k[Ws"崰
{6ĆK[u Evg^
>{_6ګaO"[-s)#M͟V\Y?\|!}@Y.9sHO)\-ș~ϥ_o`sɾѼcUN
$D%='mj|yYga;`^رsl'7G88;.:+"g^E9'=Ŗ~W,ѱ7-1>.
^-NCF#LJDgzH{d99~Ҥĭco:٬l,%zUw(GS̥Hbŭ/Q_l}RK[cIJxGJ~R8Ff:(k)?\ñ'#7s\WW֍s߳;ˉ;<Y?e"o+vFEo/vl?)z_jy$gc7ltg#]{
rgһ uGؑ" "vICuOSV`З1tz<mwLT[INVs'OoSƘ;C`=x0ayl\pp
cXK/7J߷J$'n5=&"B2R<z,1#w٬B\yhE-EUt1]gs>\p^
ǽqNEyc,mE"l9Lazd[s1<~b.8~bIH!Q%R~.m%zs ON`{
v"SU/nA).m֕R[JL)qH[S/bǧs#L/DShvi?zJutKSufo~"H{s/u~ݢ/a˶ˑT)et7.jSB xE?Is)ۍSԱ_>&KJqn[IYp"$$}ZWysDarݡK!s*ky?
[;ɫh5OCr؍U7PV^w0wh='=q}f֪QS[wO^MغvIۀfG&E"7(2?X:U1kؔy:m;(UUElZ;Cd(3_8b^b*ɪ-CpzꂭjTe.APN8[b~\Q^n)g~@G~+";rw(vf{m31b!xVSʖ1aэ ʹdYl'ԏobvJV}QJp:٪wֲRñ6l4;"b뛫 vnOXj3Afg
G=?,?bToaGѱo_ĺ=یu9F3+>{E=#GύQ<`H@9锶{}Yޣ&ߵZb7ˤd+X6`][@7/lŔB@+a;_+
qZ6rnԭm"TBsafҍDgp%f#/,dzJ"疓дqjґca"F-M|%nt_]se)q84jyt@pX,Z
eNx綮2O^L[.qX6 'rn+"rij$㷌Tk?}!a#4Tpn5ep,:悻^|<_/{Ym^CnqBbjtn5(~_~k?cPsng5/`r3wU -{(Hg pQduQ6JǷL}ɲ[7KkndGC_loij/2[^dm]ucyen Sy''gA\Sxwn9V/V .WbG7Pvn'!lY}i1}x%0ڟ;_Dn8.VM8ss7}ߩc¡/|ܚHǞO`B:/ B
oPt탡w߃Az9|rn%j!F|6FYNi-ʖP9-tڊ_qLTga1]T&ƥϝ3ѩ?|U.}zs8k%º½&
Rp1=U-FL4;2h
Qܯ :EAxX4%q-}+\IY)ێP6cy㫭(RtX1DsNWfgr侽'CHx~MY6
53 Ez9+XWbSKHnSv%,h@yH3;FXbi
LiGJei?%zm~U4rNSCc$n= m'aK)2%D J!`Bq;?b1JH:$ wW-L(^rpAuגuK=[#m̚,|ܴ?6-wE%"@l&`e%@&otṇɹmMU#D8@mblx
YЩ"@rpE3)iWv+e$7~3ƴY?bD#5uWեckd[pI[pR՚ zщm
pBFB$@6bAIU@-t9@Hi1;Bx([\ 4#@vrMBف RD
vFuVK'D>ڃےt̂<ԡ
uzMж-Af0{/.~y6"B)' v2p*"@%] D"@ DA(fJ"@ D"@ 9D"@ D"""*A D"@ "@ D"@@ @nhF D"@ DPe"@ 0'NԸl) - {m[hZ;\
i˚Up@ձ~XiV/Te"2ڭtήx_0~plG0\Ss1|fR#yTއ;mH.Roi(4]sgI
lt͛Io@^̜[rcJI/$Dڭt,?ι.w_KJ@P's
qd+O><b|=F/}gK+t.TEQP?݉\;K(J^ ~@ڲ+٢CccROJj=$eN7"JVi:TE3$_W!/*ʮ$XjEig}O.WR4K0Jy*Mg'='^
pe{oJ.-lz4]KdԢޘT"@d'-WY~س$^5ZM%_Fm)3"К֦OܖTC"@ D"@@ 8TDlD!+kWP_"'dֲc}12
~+N92z%AH7*N7<%f;1q$YR>Kt
70Tw&u_ QS*$&"Є;ޣąW.~J+{\_tf}3J)YܧKA'uXlDeϕLh"gz[m)Ki)MT֘@{ Cj5/sғT{_dηwKm<zϚv@5Թ9(:̭+?ro=noS=\7`;?/E"-ڢJ˩m%G|]Ȓ
%$"v}hףk+Q~%C{ojF-ß@AOj39Q+Z-fmǠ/m{z.ƕ<]%wGP&ոcUJ;Cl'q9wzї+fl]7al}H_{XS&.7@X;_EXTV犭.W֘h(E^kt )mUwqq_ti2wagfwI3{g8>XΊ9(0|ɕ7/7*>8t-xn}*/jKoiޛ+y Jqa~cژО_>|/]d-Q=_%8ӯʻʢRhEWSyxKTⷾ;uj+Q1x&1uœs[WD\=^h_ϚcsI!Q͒ ٻy5K?Y>!`-FmZQ䨥1}ųs[:*P[cz,uJO?:X'sX1犳=`g_(8ڲ<>AVסNSw94vda#xzjٌJ)<+7Pc0hUd#^HB?jQyrO]q]Yzq/wfK?ۺRh*ymAiޛ+} :;uRKx(cZȵwW0"n0Ga?ua8{:Qk*?_l\Q+po=$S7bUhgl?__DUq0cLENg2ZwvlR{H.tꔿN}qXÕQnk;D`}6Q3j
ѲGu?omu1e6=WoK'̤WeHl5{F?썵sK$⾤'㪿{K
qw y|=EOaeùض;w>uo//w`۠u{G\_s~Qu* 9k:~UN0Zh&d<
Dpbb_0YuƢlMdG\7ٸgD^DUtأ^tU#o˫4i~;QlDGd2Nk'>(k_ۆL웋JGZ'wޤ.6ڧZ+<jc%f> &˩}L,q&;CU*O
jNWDo(j R~Jق7X8X[Yh5Me<z}2Mh1>I$>忶ꀤw8C!~C"+e~ŕ=!\Vöǖl;0QNۃIK̃yۻGEΡ]콉IDobW!.9Emzޤ#2<zM˧:ďBhaXs0J[,.|bqqShq+F Z=wsU,xҀa?asWH?it<DYU!~a7qUV+ys"{4<vgMwH㑽sq{wQQM>
],ew݆"B{KRL~:ѠR]bUZmdޕ?,G79I<ꫩ(ʇ 7/f꾷7IrpcV{y'Yp`XPsVe|ٜ9,fb~_|6"ܛΥB dF{Ыx!zΝkBUXZ""5{2ܪ4O28@^7IGE<Ub/nbWKgv&{w
{wSESc0۳l;(z_)Ԉ>=PP`^a2̸%Qֶ7P#97c{W+O~{6Gv]lf{wV[.@,b/!V]K<%Vs*8)M$pfKrbƹtTIV>YݽE)0
Fj,puNb^oˇ(SNTu)ӿ
v
r{ݷ-O~cNk0˃!2&{w
{W43bx[~ټ WX4n/|M5o,fޛyANPtVf.^?,Jo'xRek+
_.Fi՝jYg_ENgs/wmg,[}c)iOd,ݻDOK/ujv
ײY㥹vbC"Q0 jѕˈ@l]_aLi!ٻػklG|9Fy:SحR}'c-#TdWdޕ=lK7դhV%#6ߤ+ {WۃZރFXϻg[w^]{$kv,eZ[iiwKg6'qG(o*z>=<M`S/%GKȞػ?N|uZC+FC:^E(BQܮLxEa{ȏeS {o9?jިY^`eQqoG4d~'!z$-C{Bd|niVZy>UD0Bzi24i[wH[wM
./-Po@x,kNUjv~:vG'Q?4B%Ѳl5Wywc3TOF2彗yyܹ#v[8bGyk%eϐǫ_ ]D{WkYۻKMj6h.+ PP@n>'^Gn ^vJc!R {|yc-$WRb&QK3F_cI&)H9D {I]FY-/▌U(,q !'2q@ya/")"p5:9}
˙q"X`^<Ui)Mנ6;xV%1o
wVjaT6dcY|yDc 1q -F'6;ʟbGߣ)?/߰I?ʼnػ
ma7o{woJ{ lCGd3p0Av)D$Tve0q@C,Zu
?4#"?Ã+f ԅ(NgaâQؗUy#?V8au,;[Mǽds:{8 ٻ~/;qDGԡ3e#դTbɺm7vΗPN;bux`vF߁TZ$FEFknyGwSNF*߄O0w#*PUX:U(:";gH(JUq5ݨ+ Kϲ¥(E
n>>dg@/A$mއE܈p>ڢ\e=$aT.ʞ;
$v6ywg>7KYdޕ>LlHځXlL{c9wI3ö#!7[`tnJ2pax?+:89 kI˕sU i6Ms
ez"~"9Yunr7w'<HF]NiR]DaޭMg2OmV1FV\CJ~87^?3W\>#ZhayNWy9<FVq0J.U%T]r[B{έ&N^[.wײ籱Sr:}pٜ#Ш84#={"0:0RTBc;ػ[v*oyu;$ˍy
T` TyݓSIV2:cˁۢࡾ³)HO>+J/#f0s[qŇX%K-Gcnj.r:kK$@nUiaqh3$AQeBSvز]RM,Gb9c=h5uey?t˒LV+S>,> w4٬UWNZ&7XSNdaF)}fNB]d֡#:72L9'^.3Vq;{wg>tޕlWN!.[o$EN~t/ Kuۆ$#&@nop]d6$e(<"@ D"@ Ny.wwu] ۏ%D\ ٻGG~,)'pgT*8{a$)c" v
&dﭩ {k׀fW6#G_G*
S'@K%@R[E VCucA D"@ OK]$! D"@ Dඐj"@ D"@Z;rp[P D"@ - 9-!D"@ DNDǔd2h IENDB` | PNG
IHDR I z gAMA |Q cHRM T + }> : iCCPICC Profile Xíw\SBBD@JM^t H*vtQZ.lI]{3w9̙ߙ;f EkV^^6@@LLJf t#-
,nD^[Qpl (ȩ!; puv B'.dU sŜ*Ih_^ , nf!;Qksx|Ր=,'BV$C6M.N?bdYx¼l\.9٢1af9y
3q~jD$dxfdl/3 asX~ 3DYq2e $}?+q 7Z-gGq
W3Wz(#6A(G@V-̊ }X1#E5B~&`9±0+6K2\WAFl/&ip0'ӆ-[%jفy
c^-L:أLVHlwyQRm8
/L 5Llw @:KeG^c@HrA!J MrP#<k^θX?بD1@4a k-)pKI,^Lza Yv0nU;>;\X0o +k6?'V}>2LE1wsām菞
0v;]Ďc̀ZN섘WJ-Z-X7ZXall|| s
/on\/=
\f0m5ikm.taH7[~ .И2 S ^lPjc(·B `
x"A,H3gy6PւMl;A=fpe
n{p]`#BG4]@lgGh$ IA>"B#K2d=R@_ci"҃A5 P*jdFCXtE2t5Z֢{&4z/a`,1gĒ4L-Jrۏ|
8L <gB|^Mx~
ÇA`Ap% لB9a7(,|o D"hBte18xF!>&H$
ɝIb
H%-S~<YlK 'br9y$*yDNIHU.R#7Wn.V+rr#e ŝKɤ,TPSRS˻O/?(AO#UjNNu6fL%
hi
3
t+`"*&
/g*)+V8$dRZTtLҰ2]F9R9GyUH***e*;UΨ<ct/M_JE?KW%fSRRSQWWVvB1l!MƧ 'p' '{sKPXѬ@4ל9[FDՉnK'xW2֚SSkX[G;P;O{ANF:t]]FS2lf9'ۡץ7o_@ `Aa|FûFrFFF761N0^nlD$ؤȤ)4ߴ,lY9j`a^e~pYlD2?v-Keee*̪تdɓM>?u.{6*6!666mmٶUhvvZ^[sko;;;|qtr8wp2tJqveq\vtr|]S뻳wz0=R<{zy<k=yxqv{=6Gs罯6?/Яԯ_?οa~@z@cPC BPhк[!ИGaap4<$|C~Ds$ $*?귩ĩQS>}>3+fO̻X5LDq'%OM rf/%;yxM;L/~sɌ93.Ԝ=,YYS) ){R>"Y!/{3Nj3u>KsO[<=}C@gFy ϗW{-}VdV]hvBrNJ1
?ߑ;''"$75S T[g[
T6Sd*IWQXUavst5r__2o,Zq%%YK~/.^_vie/{SO%
%[ݖo[ZirʯKeeeWW]犟GWZ㸦f-q-u+/ZxC̍nb}͔͢ͽa-[2FOՁjr^ٿM{[ٶOyoTk\[p]Knez;hYӈ6N۽o_~;0E5כBv>ёMHܦޖc![Zf[qU'N9I9詢SmymO?n~LS;Άp.ܙO]ppc/5_vywߏv9v5]q3Uϫ];w=7znݼ}kۜdyuȽ K(=(?:|cOO>/{J{ZLYsg#%)U呿J%x5z7uo߶G
?|n}?Ϥ_̾~
z4gt4%`IhZ %C7 KRyQB|&) sWb V#T؊ޱ^ "LƢm H |l@['.Dn&NʿWl˔ pHYs + YiTXtXML:com.adobe.xmp <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
<tiff:Orientation>1</tiff:Orientation>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
L'Y <IDATx^|TU)^ `h D:P%.]kwD@DB@PzD ` 2d;;;%~惙|{S}"D"@ D"Ь 7kIx"@ D"@ *"@ D"@@ @nhF D"@ DK:@ D"@ - 9-D"@ D"@. D"@ DඈfJ"@ D"@ 9D"@ D"""*A D"@ nAa MJ=}NԸy|T*؉@3k7xp7ڶ;cb'(
"N˰Tl| ͚S\U1f&ܡ߯}I1 n:Bp`8<=}-jP 2U'[&N02Ą襨:@Xmg-~Rx؇>D/44IX&)x#s27"BgeGح0;f4bNcҖ(~qC¯ʱHi:;8+Ϙxt-J]M;W+Ϋ~>3A~F/qڭʈ"[f3&'"7(-akX0+1 9~=1
<<ޮP?y܋uP$pKئv_1E.QAs(k܊բF[C]m-t.]D×Sm?$
stNG#]!Hdέ'WG [1=a݅7}7eH 7D] ڢUҸyEBV8w_8yu?bmOts
FDr.W4I]:8/ yWQV+.$5>{c[bZr4-]U?gRHg(YS_"iYO;$z-ڻm\1?)rs2#[>JUi:I&nOa@xy{?ᦪ16g>_](9Oʀ",Nqpð
u*of;~&՜ٽOayX~|"{gGOg@W(:zXR?IºMYgƖ}PGIVh5Djz5(k)H
OnGd$_lK&/UxOdXAe0!ἓy</?$'q %w6T>t8T;1|nԚ7V|\~E͈@K׳^?gA72sT/."jE*>w+-O>PVqZ%84 ÃLzog&?s6
G{).ޏ1?KxGT',A+*;>u~8h{?34NJt
2r<^]h<*Qv8ùts9eI.}u=:S:G?墲:[^1c_p~
q9mDߍ Ք$'\:2.5p%m4C^WjMocQXMg*1smH9\з}.&Rn_ZQ";̤߫
)CuY
&Ee<>MB6h7P?BR8]?%"ݍvHdUo8-H%\و<V@IWVN]gRϰp1/av=Ct{wW}7[xhvJ##%<Q}QJ<0<{,ERŘVJNz-QF),PNnfz}&
XOģ(ʷNcQ-K-^X3bQqy;yGr~od4(*C}<F"@\up:GDz)re48V^j>uY2.aicV/?DulMM1\<sv%O,/y~۟3CD1-Xk3зG.Jb"wv˿E?I
K`4~9]acRc"I](6o5^s6 زf>"}#?ajgUKm5 ?wܯI,D?+N ?xM)?{Bds2ޣ)ٍVǗ%C-W_;gJV53"<
QE,_
122|rv旡O~'8pǭyƌ?Gco12b^!`JrXa<gΡvt3`2^>0
bEkƴr*ǠůܩlE{㊋uƹ;O 1+1J}Yj}D$%m[]F8ϪɸĹ
EDD=ܢ
WltYRBȤ:tw=ՖB]-t;ZTK0k?7o=S^ۺZh<Qc\o4tMHۺl^yr
{!ǟ
&;VˎZ*>QXtՆ(HulfEhF-Ksiװ(qV߹/VZ?N䴟&16-<mY<%4ejTqIzq`p͝BpnX[Ga
*
a08R?EntW^Tԩ5Ɠ}`G\VD)UlbDCQ2A,0iLe*n?Kn ={LD]tsפ#3X
<-='}O|#rnq~wueҘˑ~6b8;g;zDLLGwkJ3έ:_~%vho*"spMV#=j<~[o0ܵygỳíƜqw3^w^Ҭ~6f\xE'
g,9}KpY{Ճu}/|3$%>3U,<:57}*?2rv6aH|y| v0K>MP[vFaؔY֕oE\k"aLN$TCڶ}LR7|,JvuѴ~Ik|B5Լ}T/@2.aT=syS'&2UiaA-bӪHz?]=qc9yCHkwzmR0Rx֡F%s*brlB
)(lڣ;"{=6O>z[%z&̽N=
6g^G_fY(IqYr<KB<#Y苭+Y^/Yh
93~t{fٹʳн{~!|oxG0e](% Dsp+*.kpٛV2c˔> 7Y378m&t5rzdsW~=lJ^X2(|´_u/J9,aFhZT*7)}9g"-;gpG[e_Ggׅta}3ښ[riqul'v?}+ð=/xbMt߉?+Yml,O6qf95fw-ZymXg}}_J d Y_<i1T%9~6苹IkefJYb%u
z: n8h54.RC'sL
KꙒ&۟jtUtbDDbr.CoGA1>6JK1t6qv[gOk8}Q~rJk%yێ74GbHmw
}Ў5TU H~<.5~r (% ۇ /?]ƃF؞~c0a
OeC喭u6e՞o8s).|Vߑj:{T%s~IҌ7~sRMjGuɯUue[#jcy5o#0ǘ$3皐gt]MޏSf%=c[60j4
O<uwwP{ٚ[nR~\ǿyL]Yv%oZ%Uϸ^_6Z/'PR@5ŕP|ivk>6)U_2ڎW1O)\HͅoLLLIٮf<"Yc^lj+yyûMCp(]Lο(ɹ$ @?>el;8.b{饐=d*
3R`p9>+7UWČ܊=
ж4q`ϖxfJtDELf%\(27qF_
+8~nnauǣ3}%s~'Ovzѽr%7
-#ԹWhb|KobÖ%"C*<0ߤsXf9V4=&W`_E5F&dAN|Y}L/>HJrvYdPWV*A={yE|UPZtӦ|y:wg*TyWDgkLa)q^d虛*%9?7R)ؑ5N@]FolJ\iy'J3-j`FR=SDuoۇVpnW-N:~+/)Tڿyƅ4qx}2/JϤnڞh=iرGګ[!
WY٥,wY,s?yHٳ
RxIDF
740V?WWNY-9oE91H\g6)~vX#VsaK-aQ|5|u$9mH,EZT/+Wڛ("{YͿ
+jS{m[<r>;ick0&Q6[^Ð~D)'_݃&A^f#{"f[yt :5(?XgOAKINKmR6W/.ƃ@\Vr3%ff-1w2
7B^ہ tO[>[Yw Ǭ[O'Ty$Uq=+JqOX(8!@?ڞN{VnDžzA
?aǺbB}Tʁ"l&rq8rU|+Vo{9%g8"bALaI*%4Xq`=⯤GYrA1ViQs
6c7}gJC?_ёAb$KY6~N|e~
m/Ka좓 -Mp٣~JV,3{"rIᘇH=,kz/&͉PE
8U?%mi$ۭ``ry:6>}kYz,?Ychq5cd1&r"k }O[ڤ6/Yx^|ówrdnzRBY)o*}(V*tP,sX2s_Z=/O]mc}a7U֔F }8~lD ֤/H&dC-,kobGw4 Xq}6QpÀK^%}\=skYʽ(IJR
2{dkKc:Y6&rOKQكlc/!y _8-GOq!}'K<ɟ$!ីQ-g[)(NBhc"rnS'\fKv+*3k[Ws"崰
{6ĆK[u Evg^
>{_6ګaO"[-s)#M͟V\Y?\|!}@Y.9sHO)\-ș~ϥ_o`sɾѼcUN
$D%='mj|yYga;`^رsl'7G88;.:+"g^E9'=Ŗ~W,ѱ7-1>.
^-NCF#LJDgzH{d99~Ҥĭco:٬l,%zUw(GS̥Hbŭ/Q_l}RK[cIJxGJ~R8Ff:(k)?\ñ'#7s\WW֍s߳;ˉ;<Y?e"o+vFEo/vl?)z_jy$gc7ltg#]{
rgһ uGؑ" "vICuOSV`З1tz<mwLT[INVs'OoSƘ;C`=x0ayl\pp
cXK/7J߷J$'n5=&"B2R<z,1#w٬B\yhE-EUt1]gs>\p^
ǽqNEyc,mE"l9Lazd[s1<~b.8~bIH!Q%R~.m%zs ON`{
v"SU/nA).m֕R[JL)qH[S/bǧs#L/DShvi?zJutKSufo~"H{s/u~ݢ/a˶ˑT)et7.jSB xE?Is)ۍSԱ_>&KJqn[IYp"$$}ZWysDarݡK!s*ky?
[;ɫh5OCr؍U7PV^w0wh='=q}f֪QS[wO^MغvIۀfG&E"7(2?X:U1kؔy:m;(UUElZ;Cd(3_8b^b*ɪ-CpzꂭjTe.APN8[b~\Q^n)g~@G~+";rw(vf{m31b!xVSʖ1aэ ʹdYl'ԏobvJV}QJp:٪wֲRñ6l4;"b뛫 vnOXj3Afg
G=?,?bToaGѱo_ĺ=یu9F3+>{E=#GύQ<`H@9锶{}Yޣ&ߵZb7ˤd+X6`][@7/lŔB@+a;_+
qZ6rnԭm"TBsafҍDgp%f#/,dzJ"疓дqjґca"F-M|%nt_]se)q84jyt@pX,Z
eNx綮2O^L[.qX6 'rn+"rij$㷌Tk?}!a#4Tpn5ep,:悻^|<_/{Ym^CnqBbjtn5(~_~k?cPsng5/`r3wU -{(Hg pQduQ6JǷL}ɲ[7KkndGC_loij/2[^dm]ucyen Sy''gA\Sxwn9V/V .WbG7Pvn'!lY}i1}x%0ڟ;_Dn8.VM8ss7}ߩc¡/|ܚHǞO`B:/ B
oPt탡w߃Az9|rn%j!F|6FYNi-ʖP9-tڊ_qLTga1]T&ƥϝ3ѩ?|U.}zs8k%º½&
Rp1=U-FL4;2h
Qܯ :EAxX4%q-}+\IY)ێP6cy㫭(RtX1DsNWfgr侽'CHx~MY6
53 Ez9+XWbSKHnSv%,h@yH3;FXbi
LiGJei?%zm~U4rNSCc$n= m'aK)2%D J!`Bq;?b1JH:$ wW-L(^rpAuגuK=[#m̚,|ܴ?6-wE%"@l&`e%@&otṇɹmMU#D8@mblx
YЩ"@rpE3)iWv+e$7~3ƴY?bD#5uWեckd[pI[pR՚ zщm
pBFB$@6bAIU@-t9@Hi1;Bx([\ 4#@vrMBف RD
vFuVK'D>ڃےt̂<ԡ
uzMж-Af0{/.~y6"B)' v2p*"@%] D"@ DA(fJ"@ D"@ 9D"@ D"""*A D"@ "@ D"@@ @nhF D"@ DPe"@ 0'NԸl) - {m[hZ;\
i˚Up@ձ~XiV/Te"2ڭtήx_0~plG0\Ss1|fR#yTއ;mH.Roi(4]sgI
lt͛Io@^̜[rcJI/$Dڭt,?ι.w_KJ@P's
qd+O><b|=F/}gK+t.TEQP?݉\;K(J^ ~@ڲ+٢CccROJj=$eN7"JVi:TE3$_W!/*ʮ$XjEig}O.WR4K0Jy*Mg'='^
pe{oJ.-lz4]KdԢޘT"@d'-WY~س$^5ZM%_Fm)3"К֦OܖTC"@ D"@@ 8TDlD!+kWP_"'dֲc}12
~+N92z%AH7*N7<%f;1q$YR>Kt
70Tw&u_ QS*$&"Є;ޣąW.~J+{\_tf}3J)YܧKA'uXlDeϕLh"gz[m)Ki)MT֘@{ Cj5/sғT{_dηwKm<zϚv@5Թ9(:̭+?ro=noS=\7`;?/E"-ڢJ˩m%G|]Ȓ
%$"v}hףk+Q~%C{ojF-ß@AOj39Q+Z-fmǠ/m{z.ƕ<]%wGP&ոcUJ;Cl'q9wzї+fl]7al}H_{XS&.7@X;_EXTV犭.W֘h(E^kt )mUwqq_ti2wagfwI3{g8>XΊ9(0|ɕ7/7*>8t-xn}*/jKoiޛ+y Jqa~cژО_>|/]d-Q=_%8ӯʻʢRhEWSyxKTⷾ;uj+Q1x&1uœs[WD\=^h_ϚcsI!Q͒ ٻy5K?Y>!`-FmZQ䨥1}ųs[:*P[cz,uJO?:X'sX1犳=`g_(8ڲ<>AVסNSw94vda#xzjٌJ)<+7Pc0hUd#^HB?jQyrO]q]Yzq/wfK?ۺRh*ymAiޛ+} :;uRKx(cZȵwW0"n0Ga?ua8{:Qk*?_l\Q+po=$S7bUhgl?__DUq0cLENg2ZwvlR{H.tꔿN}qXÕQnk;D`}6Q3j
ѲGu?omu1e6=WoK'̤WeHl5{F?썵sK$⾤'㪿{K
qw y|=EOaeùض;w>uo//w`۠u{G\_s~Qu* 9k:~UN0Zh&d<
Dpbb_0YuƢlMdG\7ٸgD^DUtأ^tU#o˫4i~;QlDGd2Nk'>(k_ۆL웋JGZ'wޤ.6ڧZ+<jc%f> &˩}L,q&;CU*O
jNWDo(j R~Jق7X8X[Yh5Me<z}2Mh1>I$>忶ꀤw8C!~C"+e~ŕ=!\Vöǖl;0QNۃIK̃yۻGEΡ]콉IDobW!.9Emzޤ#2<zM˧:ďBhaXs0J[,.|bqqShq+F Z=wsU,xҀa?asWH?it<DYU!~a7qUV+ys"{4<vgMwH㑽sq{wQQM>
],ew݆"B{KRL~:ѠR]bUZmdޕ?,G79I<ꫩ(ʇ 7/f꾷7IrpcV{y'Yp`XPsVe|ٜ9,fb~_|6"ܛΥB dF{Ыx!zΝkBUXZ""5{2ܪ4O28@^7IGE<Ub/nbWKgv&{w
{wSESc0۳l;(z_)Ԉ>=PP`^a2̸%Qֶ7P#97c{W+O~{6Gv]lf{wV[.@,b/!V]K<%Vs*8)M$pfKrbƹtTIV>YݽE)0
Fj,puNb^oˇ(SNTu)ӿ
v
r{ݷ-O~cNk0˃!2&{w
{W43bx[~ټ WX4n/|M5o,fޛyANPtVf.^?,Jo'xRek+
_.Fi՝jYg_ENgs/wmg,[}c)iOd,ݻDOK/ujv
ײY㥹vbC"Q0 jѕˈ@l]_aLi!ٻػklG|9Fy:SحR}'c-#TdWdޕ=lK7դhV%#6ߤ+ {WۃZރFXϻg[w^]{$kv,eZ[iiwKg6'qG(o*z>=<M`S/%GKȞػ?N|uZC+FC:^E(BQܮLxEa{ȏeS {o9?jިY^`eQqoG4d~'!z$-C{Bd|niVZy>UD0Bzi24i[wH[wM
./-Po@x,kNUjv~:vG'Q?4B%Ѳl5Wywc3TOF2彗yyܹ#v[8bGyk%eϐǫ_ ]D{WkYۻKMj6h.+ PP@n>'^Gn ^vJc!R {|yc-$WRb&QK3F_cI&)H9D {I]FY-/▌U(,q !'2q@ya/")"p5:9}
˙q"X`^<Ui)Mנ6;xV%1o
wVjaT6dcY|yDc 1q -F'6;ʟbGߣ)?/߰I?ʼnػ
ma7o{woJ{ lCGd3p0Av)D$Tve0q@C,Zu
?4#"?Ã+f ԅ(NgaâQؗUy#?V8au,;[Mǽds:{8 ٻ~/;qDGԡ3e#դTbɺm7vΗPN;bux`vF߁TZ$FEFknyGwSNF*߄O0w#*PUX:U(:";gH(JUq5ݨ+ Kϲ¥(E
n>>dg@/A$mއE܈p>ڢ\e=$aT.ʞ;
$v6ywg>7KYdޕ>LlHځXlL{c9wI3ö#!7[`tnJ2pax?+:89 kI˕sU i6Ms
ez"~"9Yunr7w'<HF]NiR]DaޭMg2OmV1FV\CJ~87^?3W\>#ZhayNWy9<FVq0J.U%T]r[B{έ&N^[.wײ籱Sr:}pٜ#Ш84#={"0:0RTBc;ػ[v*oyu;$ˍy
T` TyݓSIV2:cˁۢࡾ³)HO>+J/#f0s[qŇX%K-Gcnj.r:kK$@nUiaqh3$AQeBSvز]RM,Gb9c=h5uey?t˒LV+S>,> w4٬UWNZ&7XSNdaF)}fNB]d֡#:72L9'^.3Vq;{wg>tޕlWN!.[o$EN~t/ Kuۆ$#&@nop]d6$e(<"@ D"@ Ny.wwu] ۏ%D\ ٻGG~,)'pgT*8{a$)c" v
&dﭩ {k׀fW6#G_G*
S'@K%@R[E VCucA D"@ OK]$! D"@ Dඐj"@ D"@Z;rp[P D"@ - 9-!D"@ DNDǔd2h IENDB` | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./doc/images/tech-support-qq-4.png | PNG
IHDR . . "h <IDATx
puqkkKw]c/%-BD],Vv%X,Ɨ
"xK)rG""xb@$ ׄ 1A`5vhAMuu&=3=sVB@@EB!
(*
QT(DQPB!
B
QT(PBEB
(*P(DQEB!
(*
QT(DQPB!
B
QT(Pn4=l-G\W^c(((((((((grBœ/rk|EQEQEQEQEQEQEQEQEQ<6l.Ɉ(((((((((Ŧ]'(((((((((XX'z,GEQEQEQEQEQEQEQEQE1)s"sLEQEQEQEQEQEQEQEQ2E?#ro 2=DQ(EQE-#eDQEQˈbFc~"üG(((((((()$c"{>EQEQEQEQEQEQEQEQEQw
y\;~4ȃ+(((((((((<WO~YІR6\$((((((((M/S~?;ǣ
TmxCEQEQEQEQEQEQEQEQE1q|
fktNDQEQEQEQEQEQEQEQEQ9nw?3mϊXDLEQEQEQEQl>[n駟^paqq-ƿXXUDQE1◹EEQEQE~ME>EQEQE(o^EQLqʔ)uQ&DSNWd(6<H]CŠuvҴlٲ.oG]"c{駟E(*EQ($Fq˒l8o}ֲ\+9+VQ?(bCw
,wC5_=V 0"(Y-Z())9Q ,ٽ狃G
dSlPx4C$P\yGSxra#l
Y?غ ;:c?[rca^ᶽՇahal(cWUYոC)x"QEQ9Xem#G
=<O(Jiֲ-;X[GAKE2XҰRVVNۏe0y& y:+(M9+V]PdfiNVڸ|~窟uoruONb(Zw1n,G}IM@`)}:ow]}A+Zl}.IȜ iDk9SCL^<5;}qΜ9"s)8!ѤX!go*cFiiš~p+2σHܒ?^e9agG
V|/pKԱy˗Hjd
vn(%>CƛoTGa6@2@ˇumtM#3'o9I A8~}/"qݯx{nGdɰv#;qEQ
Y6[lgbKUVM AZz|_w ].Jvj̜oyӗ-&'mI@ZKΰKwcǎ(@ه+ٸUӤ3ZL"dʟ#q(4C|5#o{LksLN9=S#̐I¤>G%iӦ(
B.O>jC
oTAh63noʚC_Hf# vBV$%Zzɍ;ekkkE1&3ρewUTn(0*>k g!i<bCf(8O%3,Kλ몖d?K{
lIJ$S
",Eݪ(8X.m ,"kY]}.mSd3s+ffUSy|@۟?
䬂L2~"6#зw!2n\T ŴG]8y9
VE1Wq{k:)ZI@Y+qT '⍙2Km1
c
?.fx-bT̡=v`EQH7XXQu3`mMIVTGO8tHꃢEpHպUYvU\ITP1GKġ܅H>Iɔ%3fRdI/!(C=eLMvS;xЋi=@R[Dd<nV_aFtY)Qgʿ!?AKbXNzEQGqΜ9^i(R;5E
795f(sgphtYm.ZV$"
{á5AHb.flmv[;e.@fD.N#oU\v{W>'>wJƣl}9t [n_t*OIVt)"afm܂)FmȑEf|ip?uTvck0#߈k]ve
,Õ((Z4Xb9"JF7
yX52"F4 dG^ҥ簌-\]e<(\E1@|Y>[e}Z
MDYBxL5)L>i;;>yF#ΪPYs[%SRrr5쪗8pQ QLMMmeRPt)ZF6 9y͖ ?ܯ`ؗ 2b;nEs[#odE6z XIhF>4hL{t`E_|QE1@.\˲`KhVJݚheI)lV|.}`f5kxiU'.0Nl1َCnTW7/b<4ZbKsAш
Ep(XPPpJ}66Hlfi6Ad<("T=ulL1I
ڹKgqHúRέGC Af Ɗ ܿ!E"[)HW N=RsÁbQs;]^UpܼSIEKd6N}+#p榃_`h,o772 #=:-(LxdzJͶ6-buJE ya3@^}o❥Uv/hŠPd-
mA1cFx(Uݿ2gjf產K~6,VF(dbɊE1:Ֆm0sp*L:78["Y)(n߾#sϔ(bӡ8yH桅C
3qn^z-6KI<-?mFvMOvl2[HVd.ōs'ڥ|LpQئy4',㙼ICDYRʱwIwFHl7Ȋ 4O~-XNd"D̴
jo(qV c*
f.W_y3FHh1ڙkxb\ZFV1ُdNQ-ԙuo(:ݶ uYYy*G=G?o<L81q3w)Nti!Z+8ahF5ٓGR%6dgB?)n8pQ.;|\6h,zu=W
gPJlVftS"F{^n
{n]
~TvZpa@
EHcbQqi6nu|Gѭ&IrNv۰deTnzJ;:#'@Zq<K[2t"Y1U/?q*c+ۼ#=VQud2GuoK~GsqC.Д?n-uκKe\?0)1?=ǿѾEnⓏ
naW?dQvgFuW%uOɩ.o5:L3hA]Hs%[ K"%sReR⽉ponȞ}Л3<ޙѦMQxrύ[M68cP51i0o]$Ʃcmu8?ÌF8\|-+ITRg{\V&xFEKh$1+~0ш4:*g*Y~V/Zh9#"b~z=?L(R&%+i㞂bƌrN
Ώ_.A/"6lXGKԓ)RMu_#l:ɢpH7pmOIq$7Vb䡵sY)R^
K}(j!G#/ʢh;vragj|s{;QfwB)źLZDb].]]H3,Jة^3b߫ΧHN&1Ev=u'r(bPn=**Q]h_6m`g4Rj3wB
ShQ@Wbw gޤ! 6vjp+[U1L;~;:Qٽ3I߃*^^{hΊUwKU9J"+t-VHJ|kp̑w*1Ń$w5<j֚s$ݮ(ѭ]j3#e)wW_á~If
Z'%{d(K>+M ioH$1"
?@r-Y&=orYBҹ?hs#h_"b=[kGbM/잗`EQJe˖?kY#sO6S;%U֏2F2͊PY9,VX*ICz3+ZύTҦ}~̘:*ӌ7`<ލAp#DKZr5mrOH
[TV|v2YẀ-F~K:_Ku~h:9w2$2%/WԝoDCo8صkWc.Y2}Йe9=?f./C
陷|-,Ow-׃w}֮s/w}ohd/۵;]4}D=z( )&/aZ5_ ܬ<{ؿ$%ιfdi1cvӋ)ڹuׅ3s cJ,TcQ{[SDQK1%%ݷ?ODK4IqMI8x$tuƹ2R iU%'.ZT4ҘP߰l}.,|7 PE1(JS̀ظ)4
o|2/Sd-jPT}AX[Um%TwsЭ]^r_'t
USMDCUEQ<-{ODiyF QG%YV <wxg)P$= KZmJ|EoV.:vSڽ>
Gzo(1xscWETwUV`4'u D E
H[bd1괨"UV((VY٣qx㓓SA,?CQ%-Z()){~rT'<3e
T
SYJHV*(9/yQئxT-QײiP̘4ؐNjC_,2Mh4=>)
'rg(b<P<jEgN+Y_O9}R<`qtSb;&Eim(Cjil|SIxnIykSh^NC-a2EQIg|uj$~Ȑ$0V~(%Y|H`{EW~^
k7$_^muTCh%4%EZ#f:Z"{&*;7t9(F$XW:??qz{&J,+ccƪ(Jj{|oծJ
3Y]s((7DQ)
{(qHE1Oc; #qK1h]~^^^b:~`([^`((F]*(YQEQEQ Q|S
znHQEx /ovMMMvv1cܟ3(iFqqqFFưa:tgeXEQ{(xF%(((F
yІdC/EQEQEQEQEQEQEQEQŦC1><iyA;DQEQEQEQEQEQEQEQEQc2;;(((((((((xk=}VFSy(((((((((ظ/S^+E,~x(((((((((wDbt;٣{\~~,E,EQEQEQEQEQEQEQEQ&C1ݎ'q䆑DQEQEQEQEQEQEQEQEQI1A{ۢ\}}:GEQEQEQEQEQEQEQEQEQ>Og{((((((((((9a GEQEQEQEQEQEQEQEQE1V(6։
`QEQEQEQEQEQEQEQEQ
sm%>DQEQEQEQEQEQEQEQEQĊŁ>(((((((((*
QT(DQPB!
B
QT(PBEB
(*
QT(DQPB!
B
QT(PBEB
(*P(DQEB!
(*F IENDB` | PNG
IHDR . . "h <IDATx
puqkkKw]c/%-BD],Vv%X,Ɨ
"xK)rG""xb@$ ׄ 1A`5vhAMuu&=3=sVB@@EB!
(*
QT(DQPB!
B
QT(PBEB
(*P(DQEB!
(*
QT(DQPB!
B
QT(Pn4=l-G\W^c(((((((((grBœ/rk|EQEQEQEQEQEQEQEQEQ<6l.Ɉ(((((((((Ŧ]'(((((((((XX'z,GEQEQEQEQEQEQEQEQE1)s"sLEQEQEQEQEQEQEQEQ2E?#ro 2=DQ(EQE-#eDQEQˈbFc~"üG(((((((()$c"{>EQEQEQEQEQEQEQEQEQw
y\;~4ȃ+(((((((((<WO~YІR6\$((((((((M/S~?;ǣ
TmxCEQEQEQEQEQEQEQEQE1q|
fktNDQEQEQEQEQEQEQEQEQ9nw?3mϊXDLEQEQEQEQl>[n駟^paqq-ƿXXUDQE1◹EEQEQE~ME>EQEQE(o^EQLqʔ)uQ&DSNWd(6<H]CŠuvҴlٲ.oG]"c{駟E(*EQ($Fq˒l8o}ֲ\+9+VQ?(bCw
,wC5_=V 0"(Y-Z())9Q ,ٽ狃G
dSlPx4C$P\yGSxra#l
Y?غ ;:c?[rca^ᶽՇahal(cWUYոC)x"QEQ9Xem#G
=<O(Jiֲ-;X[GAKE2XҰRVVNۏe0y& y:+(M9+V]PdfiNVڸ|~窟uoruONb(Zw1n,G}IM@`)}:ow]}A+Zl}.IȜ iDk9SCL^<5;}qΜ9"s)8!ѤX!go*cFiiš~p+2σHܒ?^e9agG
V|/pKԱy˗Hjd
vn(%>CƛoTGa6@2@ˇumtM#3'o9I A8~}/"qݯx{nGdɰv#;qEQ
Y6[lgbKUVM AZz|_w ].Jvj̜oyӗ-&'mI@ZKΰKwcǎ(@ه+ٸUӤ3ZL"dʟ#q(4C|5#o{LksLN9=S#̐I¤>G%iӦ(
B.O>jC
oTAh63noʚC_Hf# vBV$%Zzɍ;ekkkE1&3ρewUTn(0*>k g!i<bCf(8O%3,Kλ몖d?K{
lIJ$S
",Eݪ(8X.m ,"kY]}.mSd3s+ffUSy|@۟?
䬂L2~"6#зw!2n\T ŴG]8y9
VE1Wq{k:)ZI@Y+qT '⍙2Km1
c
?.fx-bT̡=v`EQH7XXQu3`mMIVTGO8tHꃢEpHպUYvU\ITP1GKġ܅H>Iɔ%3fRdI/!(C=eLMvS;xЋi=@R[Dd<nV_aFtY)Qgʿ!?AKbXNzEQGqΜ9^i(R;5E
795f(sgphtYm.ZV$"
{á5AHb.flmv[;e.@fD.N#oU\v{W>'>wJƣl}9t [n_t*OIVt)"afm܂)FmȑEf|ip?uTvck0#߈k]ve
,Õ((Z4Xb9"JF7
yX52"F4 dG^ҥ簌-\]e<(\E1@|Y>[e}Z
MDYBxL5)L>i;;>yF#ΪPYs[%SRrr5쪗8pQ QLMMmeRPt)ZF6 9y͖ ?ܯ`ؗ 2b;nEs[#odE6z XIhF>4hL{t`E_|QE1@.\˲`KhVJݚheI)lV|.}`f5kxiU'.0Nl1َCnTW7/b<4ZbKsAш
Ep(XPPpJ}66Hlfi6Ad<("T=ulL1I
ڹKgqHúRέGC Af Ɗ ܿ!E"[)HW N=RsÁbQs;]^UpܼSIEKd6N}+#p榃_`h,o772 #=:-(LxdzJͶ6-buJE ya3@^}o❥Uv/hŠPd-
mA1cFx(Uݿ2gjf產K~6,VF(dbɊE1:Ֆm0sp*L:78["Y)(n߾#sϔ(bӡ8yH桅C
3qn^z-6KI<-?mFvMOvl2[HVd.ōs'ڥ|LpQئy4',㙼ICDYRʱwIwFHl7Ȋ 4O~-XNd"D̴
jo(qV c*
f.W_y3FHh1ڙkxb\ZFV1ُdNQ-ԙuo(:ݶ uYYy*G=G?o<L81q3w)Nti!Z+8ahF5ٓGR%6dgB?)n8pQ.;|\6h,zu=W
gPJlVftS"F{^n
{n]
~TvZpa@
EHcbQqi6nu|Gѭ&IrNv۰deTnzJ;:#'@Zq<K[2t"Y1U/?q*c+ۼ#=VQud2GuoK~GsqC.Д?n-uκKe\?0)1?=ǿѾEnⓏ
naW?dQvgFuW%uOɩ.o5:L3hA]Hs%[ K"%sReR⽉ponȞ}Л3<ޙѦMQxrύ[M68cP51i0o]$Ʃcmu8?ÌF8\|-+ITRg{\V&xFEKh$1+~0ш4:*g*Y~V/Zh9#"b~z=?L(R&%+i㞂bƌrN
Ώ_.A/"6lXGKԓ)RMu_#l:ɢpH7pmOIq$7Vb䡵sY)R^
K}(j!G#/ʢh;vragj|s{;QfwB)źLZDb].]]H3,Jة^3b߫ΧHN&1Ev=u'r(bPn=**Q]h_6m`g4Rj3wB
ShQ@Wbw gޤ! 6vjp+[U1L;~;:Qٽ3I߃*^^{hΊUwKU9J"+t-VHJ|kp̑w*1Ń$w5<j֚s$ݮ(ѭ]j3#e)wW_á~If
Z'%{d(K>+M ioH$1"
?@r-Y&=orYBҹ?hs#h_"b=[kGbM/잗`EQJe˖?kY#sO6S;%U֏2F2͊PY9,VX*ICz3+ZύTҦ}~̘:*ӌ7`<ލAp#DKZr5mrOH
[TV|v2YẀ-F~K:_Ku~h:9w2$2%/WԝoDCo8صkWc.Y2}Йe9=?f./C
陷|-,Ow-׃w}֮s/w}ohd/۵;]4}D=z( )&/aZ5_ ܬ<{ؿ$%ιfdi1cvӋ)ڹuׅ3s cJ,TcQ{[SDQK1%%ݷ?ODK4IqMI8x$tuƹ2R iU%'.ZT4ҘP߰l}.,|7 PE1(JS̀ظ)4
o|2/Sd-jPT}AX[Um%TwsЭ]^r_'t
USMDCUEQ<-{ODiyF QG%YV <wxg)P$= KZmJ|EoV.:vSڽ>
Gzo(1xscWETwUV`4'u D E
H[bd1괨"UV((VY٣qx㓓SA,?CQ%-Z()){~rT'<3e
T
SYJHV*(9/yQئxT-QײiP̘4ؐNjC_,2Mh4=>)
'rg(b<P<jEgN+Y_O9}R<`qtSb;&Eim(Cjil|SIxnIykSh^NC-a2EQIg|uj$~Ȑ$0V~(%Y|H`{EW~^
k7$_^muTCh%4%EZ#f:Z"{&*;7t9(F$XW:??qz{&J,+ccƪ(Jj{|oծJ
3Y]s((7DQ)
{(qHE1Oc; #qK1h]~^^^b:~`([^`((F]*(YQEQEQ Q|S
znHQEx /ovMMMvv1cܟ3(iFqqqFFưa:tgeXEQ{(xF%(((F
yІdC/EQEQEQEQEQEQEQEQŦC1><iyA;DQEQEQEQEQEQEQEQEQc2;;(((((((((xk=}VFSy(((((((((ظ/S^+E,~x(((((((((wDbt;٣{\~~,E,EQEQEQEQEQEQEQEQ&C1ݎ'q䆑DQEQEQEQEQEQEQEQEQI1A{ۢ\}}:GEQEQEQEQEQEQEQEQEQ>Og{((((((((((9a GEQEQEQEQEQEQEQEQE1V(6։
`QEQEQEQEQEQEQEQEQ
sm%>DQEQEQEQEQEQEQEQEQĊŁ>(((((((((*
QT(DQPB!
B
QT(PBEB
(*
QT(DQPB!
B
QT(PBEB
(*P(DQEB!
(*F IENDB` | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/FavoriteRepository.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.repository;
import com.ctrip.framework.apollo.portal.entity.po.Favorite;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FavoriteRepository extends PagingAndSortingRepository<Favorite, Long> {
List<Favorite> findByUserIdOrderByPositionAscDataChangeCreatedTimeAsc(String userId, Pageable page);
List<Favorite> findByAppIdOrderByPositionAscDataChangeCreatedTimeAsc(String appId, Pageable page);
Favorite findFirstByUserIdOrderByPositionAscDataChangeCreatedTimeAsc(String userId);
Favorite findByUserIdAndAppId(String userId, String appId);
@Modifying
@Query("UPDATE Favorite SET IsDeleted=1,DataChange_LastModifiedBy = ?2 WHERE AppId=?1")
int batchDeleteByAppId(String appId, String operator);
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.repository;
import com.ctrip.framework.apollo.portal.entity.po.Favorite;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FavoriteRepository extends PagingAndSortingRepository<Favorite, Long> {
List<Favorite> findByUserIdOrderByPositionAscDataChangeCreatedTimeAsc(String userId, Pageable page);
List<Favorite> findByAppIdOrderByPositionAscDataChangeCreatedTimeAsc(String appId, Pageable page);
Favorite findFirstByUserIdOrderByPositionAscDataChangeCreatedTimeAsc(String userId);
Favorite findByUserIdAndAppId(String userId, String appId);
@Modifying
@Query("UPDATE Favorite SET IsDeleted=1,DataChange_LastModifiedBy = ?2 WHERE AppId=?1")
int batchDeleteByAppId(String appId, String operator);
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.utils;
import com.ctrip.framework.apollo.common.exception.BeanUtilsException;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.util.CollectionUtils;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class BeanUtils {
/**
* <pre>
* List<UserBean> userBeans = userDao.queryUsers();
* List<UserDTO> userDTOs = BeanUtil.batchTransform(UserDTO.class, userBeans);
* </pre>
*/
public static <T> List<T> batchTransform(final Class<T> clazz, List<?> srcList) {
if (CollectionUtils.isEmpty(srcList)) {
return Collections.emptyList();
}
List<T> result = new ArrayList<>(srcList.size());
for (Object srcObject : srcList) {
result.add(transform(clazz, srcObject));
}
return result;
}
/**
* 封装{@link org.springframework.beans.BeanUtils#copyProperties},惯用与直接将转换结果返回
*
* <pre>
* UserBean userBean = new UserBean("username");
* return BeanUtil.transform(UserDTO.class, userBean);
* </pre>
*/
public static <T> T transform(Class<T> clazz, Object src) {
if (src == null) {
return null;
}
T instance;
try {
instance = clazz.newInstance();
} catch (Exception e) {
throw new BeanUtilsException(e);
}
org.springframework.beans.BeanUtils.copyProperties(src, instance, getNullPropertyNames(src));
return instance;
}
private static String[] getNullPropertyNames(Object source) {
final BeanWrapper src = new BeanWrapperImpl(source);
PropertyDescriptor[] pds = src.getPropertyDescriptors();
Set<String> emptyNames = new HashSet<>();
for (PropertyDescriptor pd : pds) {
Object srcValue = src.getPropertyValue(pd.getName());
if (srcValue == null) {
emptyNames.add(pd.getName());
}
}
String[] result = new String[emptyNames.size()];
return emptyNames.toArray(result);
}
/**
* 用于将一个列表转换为列表中的对象的某个属性映射到列表中的对象
*
* <pre>
* List<UserDTO> userList = userService.queryUsers();
* Map<Integer, userDTO> userIdToUser = BeanUtil.mapByKey("userId", userList);
* </pre>
*
* @param key 属性名
*/
@SuppressWarnings("unchecked")
public static <K, V> Map<K, V> mapByKey(String key, List<?> list) {
Map<K, V> map = new HashMap<>();
if (CollectionUtils.isEmpty(list)) {
return map;
}
try {
Class<?> clazz = list.get(0).getClass();
Field field = deepFindField(clazz, key);
if (field == null) {
throw new IllegalArgumentException("Could not find the key");
}
field.setAccessible(true);
for (Object o : list) {
map.put((K) field.get(o), (V) o);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return map;
}
/**
* 根据列表里面的属性聚合
*
* <pre>
* List<ShopDTO> shopList = shopService.queryShops();
* Map<Integer, List<ShopDTO>> city2Shops = BeanUtil.aggByKeyToList("cityId", shopList);
* </pre>
*/
@SuppressWarnings("unchecked")
public static <K, V> Map<K, List<V>> aggByKeyToList(String key, List<?> list) {
Map<K, List<V>> map = new HashMap<>();
if (CollectionUtils.isEmpty(list)) {// 防止外面传入空list
return map;
}
try {
Class<?> clazz = list.get(0).getClass();
Field field = deepFindField(clazz, key);
if (field == null) {
throw new IllegalArgumentException("Could not find the key");
}
field.setAccessible(true);
for (Object o : list) {
K k = (K) field.get(o);
map.computeIfAbsent(k, k1 -> new ArrayList<>());
map.get(k).add((V) o);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return map;
}
/**
* 用于将一个对象的列表转换为列表中对象的属性集合
*
* <pre>
* List<UserDTO> userList = userService.queryUsers();
* Set<Integer> userIds = BeanUtil.toPropertySet("userId", userList);
* </pre>
*/
@SuppressWarnings("unchecked")
public static <K> Set<K> toPropertySet(String key, List<?> list) {
Set<K> set = new HashSet<>();
if (CollectionUtils.isEmpty(list)) {// 防止外面传入空list
return set;
}
try {
Class<?> clazz = list.get(0).getClass();
Field field = deepFindField(clazz, key);
if (field == null) {
throw new IllegalArgumentException("Could not find the key");
}
field.setAccessible(true);
for (Object o : list) {
set.add((K)field.get(o));
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return set;
}
private static Field deepFindField(Class<?> clazz, String key) {
Field field = null;
while (!clazz.getName().equals(Object.class.getName())) {
try {
field = clazz.getDeclaredField(key);
if (field != null) {
break;
}
} catch (Exception e) {
clazz = clazz.getSuperclass();
}
}
return field;
}
/**
* 获取某个对象的某个属性
*/
public static Object getProperty(Object obj, String fieldName) {
try {
Field field = deepFindField(obj.getClass(), fieldName);
if (field != null) {
field.setAccessible(true);
return field.get(obj);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return null;
}
/**
* 设置某个对象的某个属性
*/
public static void setProperty(Object obj, String fieldName, Object value) {
try {
Field field = deepFindField(obj.getClass(), fieldName);
if (field != null) {
field.setAccessible(true);
field.set(obj, value);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
}
/**
*
* @param source
* @param target
*/
public static void copyProperties(Object source, Object target, String... ignoreProperties) {
org.springframework.beans.BeanUtils.copyProperties(source, target, ignoreProperties);
}
/**
* The copy will ignore <em>BaseEntity</em> field
*
* @param source
* @param target
*/
public static void copyEntityProperties(Object source, Object target) {
org.springframework.beans.BeanUtils.copyProperties(source, target, COPY_IGNORED_PROPERTIES);
}
private static final String[] COPY_IGNORED_PROPERTIES = {"id", "dataChangeCreatedBy", "dataChangeCreatedTime", "dataChangeLastModifiedTime"};
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.utils;
import com.ctrip.framework.apollo.common.exception.BeanUtilsException;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.util.CollectionUtils;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class BeanUtils {
/**
* <pre>
* List<UserBean> userBeans = userDao.queryUsers();
* List<UserDTO> userDTOs = BeanUtil.batchTransform(UserDTO.class, userBeans);
* </pre>
*/
public static <T> List<T> batchTransform(final Class<T> clazz, List<?> srcList) {
if (CollectionUtils.isEmpty(srcList)) {
return Collections.emptyList();
}
List<T> result = new ArrayList<>(srcList.size());
for (Object srcObject : srcList) {
result.add(transform(clazz, srcObject));
}
return result;
}
/**
* 封装{@link org.springframework.beans.BeanUtils#copyProperties},惯用与直接将转换结果返回
*
* <pre>
* UserBean userBean = new UserBean("username");
* return BeanUtil.transform(UserDTO.class, userBean);
* </pre>
*/
public static <T> T transform(Class<T> clazz, Object src) {
if (src == null) {
return null;
}
T instance;
try {
instance = clazz.newInstance();
} catch (Exception e) {
throw new BeanUtilsException(e);
}
org.springframework.beans.BeanUtils.copyProperties(src, instance, getNullPropertyNames(src));
return instance;
}
private static String[] getNullPropertyNames(Object source) {
final BeanWrapper src = new BeanWrapperImpl(source);
PropertyDescriptor[] pds = src.getPropertyDescriptors();
Set<String> emptyNames = new HashSet<>();
for (PropertyDescriptor pd : pds) {
Object srcValue = src.getPropertyValue(pd.getName());
if (srcValue == null) {
emptyNames.add(pd.getName());
}
}
String[] result = new String[emptyNames.size()];
return emptyNames.toArray(result);
}
/**
* 用于将一个列表转换为列表中的对象的某个属性映射到列表中的对象
*
* <pre>
* List<UserDTO> userList = userService.queryUsers();
* Map<Integer, userDTO> userIdToUser = BeanUtil.mapByKey("userId", userList);
* </pre>
*
* @param key 属性名
*/
@SuppressWarnings("unchecked")
public static <K, V> Map<K, V> mapByKey(String key, List<?> list) {
Map<K, V> map = new HashMap<>();
if (CollectionUtils.isEmpty(list)) {
return map;
}
try {
Class<?> clazz = list.get(0).getClass();
Field field = deepFindField(clazz, key);
if (field == null) {
throw new IllegalArgumentException("Could not find the key");
}
field.setAccessible(true);
for (Object o : list) {
map.put((K) field.get(o), (V) o);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return map;
}
/**
* 根据列表里面的属性聚合
*
* <pre>
* List<ShopDTO> shopList = shopService.queryShops();
* Map<Integer, List<ShopDTO>> city2Shops = BeanUtil.aggByKeyToList("cityId", shopList);
* </pre>
*/
@SuppressWarnings("unchecked")
public static <K, V> Map<K, List<V>> aggByKeyToList(String key, List<?> list) {
Map<K, List<V>> map = new HashMap<>();
if (CollectionUtils.isEmpty(list)) {// 防止外面传入空list
return map;
}
try {
Class<?> clazz = list.get(0).getClass();
Field field = deepFindField(clazz, key);
if (field == null) {
throw new IllegalArgumentException("Could not find the key");
}
field.setAccessible(true);
for (Object o : list) {
K k = (K) field.get(o);
map.computeIfAbsent(k, k1 -> new ArrayList<>());
map.get(k).add((V) o);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return map;
}
/**
* 用于将一个对象的列表转换为列表中对象的属性集合
*
* <pre>
* List<UserDTO> userList = userService.queryUsers();
* Set<Integer> userIds = BeanUtil.toPropertySet("userId", userList);
* </pre>
*/
@SuppressWarnings("unchecked")
public static <K> Set<K> toPropertySet(String key, List<?> list) {
Set<K> set = new HashSet<>();
if (CollectionUtils.isEmpty(list)) {// 防止外面传入空list
return set;
}
try {
Class<?> clazz = list.get(0).getClass();
Field field = deepFindField(clazz, key);
if (field == null) {
throw new IllegalArgumentException("Could not find the key");
}
field.setAccessible(true);
for (Object o : list) {
set.add((K)field.get(o));
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return set;
}
private static Field deepFindField(Class<?> clazz, String key) {
Field field = null;
while (!clazz.getName().equals(Object.class.getName())) {
try {
field = clazz.getDeclaredField(key);
if (field != null) {
break;
}
} catch (Exception e) {
clazz = clazz.getSuperclass();
}
}
return field;
}
/**
* 获取某个对象的某个属性
*/
public static Object getProperty(Object obj, String fieldName) {
try {
Field field = deepFindField(obj.getClass(), fieldName);
if (field != null) {
field.setAccessible(true);
return field.get(obj);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
return null;
}
/**
* 设置某个对象的某个属性
*/
public static void setProperty(Object obj, String fieldName, Object value) {
try {
Field field = deepFindField(obj.getClass(), fieldName);
if (field != null) {
field.setAccessible(true);
field.set(obj, value);
}
} catch (Exception e) {
throw new BeanUtilsException(e);
}
}
/**
*
* @param source
* @param target
*/
public static void copyProperties(Object source, Object target, String... ignoreProperties) {
org.springframework.beans.BeanUtils.copyProperties(source, target, ignoreProperties);
}
/**
* The copy will ignore <em>BaseEntity</em> field
*
* @param source
* @param target
*/
public static void copyEntityProperties(Object source, Object target) {
org.springframework.beans.BeanUtils.copyProperties(source, target, COPY_IGNORED_PROPERTIES);
}
private static final String[] COPY_IGNORED_PROPERTIES = {"id", "dataChangeCreatedBy", "dataChangeCreatedTime", "dataChangeLastModifiedTime"};
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/txtresolver/FileTextResolver.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.component.txtresolver;
import com.ctrip.framework.apollo.common.dto.ItemChangeSets;
import com.ctrip.framework.apollo.common.dto.ItemDTO;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
@Component("fileTextResolver")
public class FileTextResolver implements ConfigTextResolver {
@Override
public ItemChangeSets resolve(long namespaceId, String configText, List<ItemDTO> baseItems) {
ItemChangeSets changeSets = new ItemChangeSets();
if (CollectionUtils.isEmpty(baseItems) && StringUtils.isEmpty(configText)) {
return changeSets;
}
if (CollectionUtils.isEmpty(baseItems)) {
changeSets.addCreateItem(createItem(namespaceId, 0, configText));
} else {
ItemDTO beforeItem = baseItems.get(0);
if (!configText.equals(beforeItem.getValue())) {//update
changeSets.addUpdateItem(createItem(namespaceId, beforeItem.getId(), configText));
}
}
return changeSets;
}
private ItemDTO createItem(long namespaceId, long itemId, String value) {
ItemDTO item = new ItemDTO();
item.setId(itemId);
item.setNamespaceId(namespaceId);
item.setValue(value);
item.setLineNum(1);
item.setKey(ConfigConsts.CONFIG_FILE_CONTENT_KEY);
return item;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.component.txtresolver;
import com.ctrip.framework.apollo.common.dto.ItemChangeSets;
import com.ctrip.framework.apollo.common.dto.ItemDTO;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
@Component("fileTextResolver")
public class FileTextResolver implements ConfigTextResolver {
@Override
public ItemChangeSets resolve(long namespaceId, String configText, List<ItemDTO> baseItems) {
ItemChangeSets changeSets = new ItemChangeSets();
if (CollectionUtils.isEmpty(baseItems) && StringUtils.isEmpty(configText)) {
return changeSets;
}
if (CollectionUtils.isEmpty(baseItems)) {
changeSets.addCreateItem(createItem(namespaceId, 0, configText));
} else {
ItemDTO beforeItem = baseItems.get(0);
if (!configText.equals(beforeItem.getValue())) {//update
changeSets.addUpdateItem(createItem(namespaceId, beforeItem.getId(), configText));
}
}
return changeSets;
}
private ItemDTO createItem(long namespaceId, long itemId, String value) {
ItemDTO item = new ItemDTO();
item.setId(itemId);
item.setNamespaceId(namespaceId);
item.setValue(value);
item.setLineNum(1);
item.setKey(ConfigConsts.CONFIG_FILE_CONTENT_KEY);
return item;
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./.git/hooks/pre-receive.sample | #!/bin/sh
#
# An example hook script to make use of push options.
# The example simply echoes all push options that start with 'echoback='
# and rejects all pushes when the "reject" push option is used.
#
# To enable this hook, rename this file to "pre-receive".
if test -n "$GIT_PUSH_OPTION_COUNT"
then
i=0
while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
do
eval "value=\$GIT_PUSH_OPTION_$i"
case "$value" in
echoback=*)
echo "echo from the pre-receive-hook: ${value#*=}" >&2
;;
reject)
exit 1
esac
i=$((i + 1))
done
fi
| #!/bin/sh
#
# An example hook script to make use of push options.
# The example simply echoes all push options that start with 'echoback='
# and rejects all pushes when the "reject" push option is used.
#
# To enable this hook, rename this file to "pre-receive".
if test -n "$GIT_PUSH_OPTION_COUNT"
then
i=0
while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
do
eval "value=\$GIT_PUSH_OPTION_$i"
case "$value" in
echoback=*)
echo "echo from the pre-receive-hook: ${value#*=}" >&2
;;
reject)
exit 1
esac
i=$((i + 1))
done
fi
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/sql/delta/v170-v180/apolloconfigdb-v170-v180.sql | --
-- Copyright 2021 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
# delta schema to upgrade apollo config db from v1.7.0 to v1.8.0
Use ApolloConfigDB;
alter table `AppNamespace` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `Cluster` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `GrayReleaseRule` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `Instance` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `InstanceConfig` change ConfigAppId ConfigAppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id';
alter table `ReleaseHistory` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
| --
-- Copyright 2021 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
# delta schema to upgrade apollo config db from v1.7.0 to v1.8.0
Use ApolloConfigDB;
alter table `AppNamespace` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `Cluster` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `GrayReleaseRule` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `Instance` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
alter table `InstanceConfig` change ConfigAppId ConfigAppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id';
alter table `ReleaseHistory` change AppId AppId varchar(64) NOT NULL DEFAULT 'default' COMMENT 'app id';
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/sql/delta/v151-v160/apolloconfigdb-v151-v160.sql | --
-- Copyright 2021 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
# delta schema to upgrade apollo config db from v1.5.1 to v1.6.0
Use ApolloConfigDB;
CREATE TABLE `AccessKey` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret',
`IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId` (`AppId`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥'; | --
-- Copyright 2021 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
# delta schema to upgrade apollo config db from v1.5.1 to v1.6.0
Use ApolloConfigDB;
CREATE TABLE `AccessKey` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret',
`IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId` (`AppId`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥'; | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./docs/css/dark.css | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
@import url("fonts.css");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#ea6f5a);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:999999}.search .search-keyword,.search a:hover{color:var(--theme-color,#ea6f5a)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#c8c8c8;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:10}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#ea6f5a)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#ea6f5a)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative;cursor:pointer}.app-nav li ul{background-color:#fff;border:1px solid;border-color:#ddd #ddd #ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{-webkit-animation:octocat-wave .56s ease-in-out;animation:octocat-wave .56s ease-in-out}.github-corner svg{color:#3f3f3f;fill:var(--theme-color,#ea6f5a);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#c8c8c8}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:20}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53.3%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53.3%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(63,63,63,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:30;cursor:pointer}.sidebar-toggle:hover .sidebar-toggle-button{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#ea6f5a);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:80%;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#3f3f3f;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#c8c8c8}.markdown-section p.warn{background:rgba(234,111,90,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(63,63,63,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{-webkit-animation:none;animation:none}.github-corner .octo-arm{-webkit-animation:octocat-wave .56s ease-in-out;animation:octocat-wave .56s ease-in-out}}@-webkit-keyframes octocat-wave{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@keyframes octocat-wave{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;width:100vw;display:none}section.cover.show{display:flex}section.cover.has-mask .mask{background-color:#3f3f3f;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{flex:1;margin:-20px 16px 0;text-align:center;position:relative}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border-radius:2rem;border:1px solid var(--theme-color,#ea6f5a);box-sizing:border-box;color:var(--theme-color,#ea6f5a);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#ea6f5a);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#ea6f5a);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#ea6f5a)}.sidebar,body{background-color:#3f3f3f}.sidebar{color:#c8c8c8}.sidebar li{margin:6px 15px 6px 0}.sidebar ul li a{color:#c8c8c8;font-size:14px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#657b83;font-weight:600}.markdown-section a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#ea6f5a);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{background-color:#282828;border-radius:2px;color:#657b83;font-family:Roboto Mono,Monaco,courier,monospace;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section>:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) code{font-size:.8rem}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#282828;font-family:Roboto Mono,Monaco,courier,monospace;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#ea6f5a)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#ea6f5a)}.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#282828;border-radius:2px;color:#657b83;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem;position:relative;left:auto}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0}.markdown-section p.tip{background-color:#282828;color:#657b83}input[type=search]{background:#4f4f4f;border-color:#4f4f4f;color:#c8c8c8} | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
@import url("fonts.css");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#ea6f5a);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:999999}.search .search-keyword,.search a:hover{color:var(--theme-color,#ea6f5a)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#c8c8c8;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:10}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#ea6f5a)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#ea6f5a)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative;cursor:pointer}.app-nav li ul{background-color:#fff;border:1px solid;border-color:#ddd #ddd #ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{-webkit-animation:octocat-wave .56s ease-in-out;animation:octocat-wave .56s ease-in-out}.github-corner svg{color:#3f3f3f;fill:var(--theme-color,#ea6f5a);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#c8c8c8}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:20}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53.3%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53.3%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(63,63,63,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:30;cursor:pointer}.sidebar-toggle:hover .sidebar-toggle-button{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#ea6f5a);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:80%;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#3f3f3f;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#c8c8c8}.markdown-section p.warn{background:rgba(234,111,90,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(63,63,63,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{-webkit-animation:none;animation:none}.github-corner .octo-arm{-webkit-animation:octocat-wave .56s ease-in-out;animation:octocat-wave .56s ease-in-out}}@-webkit-keyframes octocat-wave{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@keyframes octocat-wave{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;width:100vw;display:none}section.cover.show{display:flex}section.cover.has-mask .mask{background-color:#3f3f3f;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{flex:1;margin:-20px 16px 0;text-align:center;position:relative}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border-radius:2rem;border:1px solid var(--theme-color,#ea6f5a);box-sizing:border-box;color:var(--theme-color,#ea6f5a);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#ea6f5a);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#ea6f5a);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#ea6f5a)}.sidebar,body{background-color:#3f3f3f}.sidebar{color:#c8c8c8}.sidebar li{margin:6px 15px 6px 0}.sidebar ul li a{color:#c8c8c8;font-size:14px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#657b83;font-weight:600}.markdown-section a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#ea6f5a);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{background-color:#282828;border-radius:2px;color:#657b83;font-family:Roboto Mono,Monaco,courier,monospace;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section>:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) code{font-size:.8rem}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#282828;font-family:Roboto Mono,Monaco,courier,monospace;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#ea6f5a)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#ea6f5a)}.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#282828;border-radius:2px;color:#657b83;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem;position:relative;left:auto}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0}.markdown-section p.tip{background-color:#282828;color:#657b83}input[type=search]{background:#4f4f4f;border-color:#4f4f4f;color:#c8c8c8} | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/EnvController.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.controller;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.environment.Env;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping("/envs")
public class EnvController {
private final PortalSettings portalSettings;
public EnvController(final PortalSettings portalSettings) {
this.portalSettings = portalSettings;
}
@GetMapping
public List<String> envs() {
List<String> environments = new ArrayList<>();
for(Env env : portalSettings.getActiveEnvs()) {
environments.add(env.toString());
}
return environments;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.controller;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.environment.Env;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping("/envs")
public class EnvController {
private final PortalSettings portalSettings;
public EnvController(final PortalSettings portalSettings) {
this.portalSettings = portalSettings;
}
@GetMapping
public List<String> envs() {
List<String> environments = new ArrayList<>();
for(Env env : portalSettings.getActiveEnvs()) {
environments.add(env.toString());
}
return environments;
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/resources/static/scripts/services/OrganizationService.js | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
appService.service("OrganizationService", ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var organization_source = $resource("", {}, {
find_organizations: {
method: 'GET',
isArray: true,
url: AppUtil.prefixPath() + '/organizations'
}
});
return {
find_organizations: function () {
var d = $q.defer();
organization_source.find_organizations({}, function (result) {
d.resolve(result);
}, function (result) {
d.reject(result);
});
return d.promise;
}
}
}]);
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
appService.service("OrganizationService", ['$resource', '$q', 'AppUtil', function ($resource, $q, AppUtil) {
var organization_source = $resource("", {}, {
find_organizations: {
method: 'GET',
isArray: true,
url: AppUtil.prefixPath() + '/organizations'
}
});
return {
find_organizations: function () {
var d = $q.defer();
organization_source.find_organizations({}, function (result) {
d.resolve(result);
}, function (result) {
d.reject(result);
});
return d.promise;
}
}
}]);
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/flyway/configdb/V1.0.0__initialization.sql | --
-- Copyright 2021 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Create Database
# ------------------------------------------------------------
CREATE DATABASE IF NOT EXISTS ApolloConfigDB DEFAULT CHARACTER SET = utf8mb4;
Use ApolloConfigDB;
# Dump of table app
# ------------------------------------------------------------
DROP TABLE IF EXISTS `App`;
CREATE TABLE `App` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
`OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
`OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
`OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
`OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId` (`AppId`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Name` (`Name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
# Dump of table appnamespace
# ------------------------------------------------------------
DROP TABLE IF EXISTS `AppNamespace`;
CREATE TABLE `AppNamespace` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一',
`AppId` varchar(32) NOT NULL DEFAULT '' COMMENT 'app id',
`Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
`IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
`Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_AppId` (`AppId`),
KEY `Name_AppId` (`Name`,`AppId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
# Dump of table audit
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Audit`;
CREATE TABLE `Audit` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名',
`EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID',
`OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型',
`Comment` varchar(500) DEFAULT NULL COMMENT '备注',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表';
# Dump of table cluster
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Cluster`;
CREATE TABLE `Cluster` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字',
`AppId` varchar(32) NOT NULL DEFAULT '' COMMENT 'App id',
`ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_AppId_Name` (`AppId`,`Name`),
KEY `IX_ParentClusterId` (`ParentClusterId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群';
# Dump of table commit
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Commit`;
CREATE TABLE `Commit` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`ChangeSets` longtext NOT NULL COMMENT '修改变更集',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`Comment` varchar(500) DEFAULT NULL COMMENT '备注',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `AppId` (`AppId`(191)),
KEY `ClusterName` (`ClusterName`(191)),
KEY `NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表';
# Dump of table grayreleaserule
# ------------------------------------------------------------
DROP TABLE IF EXISTS `GrayReleaseRule`;
CREATE TABLE `GrayReleaseRule` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`AppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
`NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
`BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name',
`Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则',
`ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release',
`BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表';
# Dump of table instance
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Instance`;
CREATE TABLE `Instance` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`AppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name',
`Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`),
KEY `IX_IP` (`Ip`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例';
# Dump of table instanceconfig
# ------------------------------------------------------------
DROP TABLE IF EXISTS `InstanceConfig`;
CREATE TABLE `InstanceConfig` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id',
`ConfigAppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config App Id',
`ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name',
`ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name',
`ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
`ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`),
KEY `IX_ReleaseKey` (`ReleaseKey`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息';
# Dump of table item
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Item`;
CREATE TABLE `Item` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
`Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
`Value` longtext NOT NULL COMMENT '配置项值',
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
`LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_GroupId` (`NamespaceId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目';
# Dump of table namespace
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Namespace`;
CREATE TABLE `Namespace` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId_ClusterName_NamespaceName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间';
# Dump of table namespacelock
# ------------------------------------------------------------
DROP TABLE IF EXISTS `NamespaceLock`;
CREATE TABLE `NamespaceLock` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT 'default' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
`IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_NamespaceId` (`NamespaceId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁';
# Dump of table release
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Release`;
CREATE TABLE `Release` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
`Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字',
`Comment` varchar(256) DEFAULT NULL COMMENT '发布说明',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`Configurations` longtext NOT NULL COMMENT '发布配置',
`IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_ReleaseKey` (`ReleaseKey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布';
# Dump of table releasehistory
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ReleaseHistory`;
CREATE TABLE `ReleaseHistory` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`AppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名',
`ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id',
`PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId',
`Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度',
`OperationContext` longtext NOT NULL COMMENT '发布上下文信息',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`),
KEY `IX_ReleaseId` (`ReleaseId`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史';
# Dump of table releasemessage
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ReleaseMessage`;
CREATE TABLE `ReleaseMessage` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Message` (`Message`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息';
# Dump of table serverconfig
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ServerConfig`;
CREATE TABLE `ServerConfig` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
`Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群',
`Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_Key` (`Key`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
# Config
# ------------------------------------------------------------
INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`)
VALUES
('eureka.service.url', 'default', 'http://localhost:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'),
('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'),
('item.key.length.limit', 'default', '128', 'item key 最大长度限制'),
('item.value.length.limit', 'default', '20000', 'item value最大长度限制'),
('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!');
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| --
-- Copyright 2021 Apollo Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Create Database
# ------------------------------------------------------------
CREATE DATABASE IF NOT EXISTS ApolloConfigDB DEFAULT CHARACTER SET = utf8mb4;
Use ApolloConfigDB;
# Dump of table app
# ------------------------------------------------------------
DROP TABLE IF EXISTS `App`;
CREATE TABLE `App` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
`OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id',
`OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
`OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
`OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId` (`AppId`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Name` (`Name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
# Dump of table appnamespace
# ------------------------------------------------------------
DROP TABLE IF EXISTS `AppNamespace`;
CREATE TABLE `AppNamespace` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一',
`AppId` varchar(32) NOT NULL DEFAULT '' COMMENT 'app id',
`Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
`IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
`Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_AppId` (`AppId`),
KEY `Name_AppId` (`Name`,`AppId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
# Dump of table audit
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Audit`;
CREATE TABLE `Audit` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名',
`EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID',
`OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型',
`Comment` varchar(500) DEFAULT NULL COMMENT '备注',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表';
# Dump of table cluster
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Cluster`;
CREATE TABLE `Cluster` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字',
`AppId` varchar(32) NOT NULL DEFAULT '' COMMENT 'App id',
`ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_AppId_Name` (`AppId`,`Name`),
KEY `IX_ParentClusterId` (`ParentClusterId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群';
# Dump of table commit
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Commit`;
CREATE TABLE `Commit` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`ChangeSets` longtext NOT NULL COMMENT '修改变更集',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`Comment` varchar(500) DEFAULT NULL COMMENT '备注',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `AppId` (`AppId`(191)),
KEY `ClusterName` (`ClusterName`(191)),
KEY `NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表';
# Dump of table grayreleaserule
# ------------------------------------------------------------
DROP TABLE IF EXISTS `GrayReleaseRule`;
CREATE TABLE `GrayReleaseRule` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`AppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
`NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
`BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name',
`Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则',
`ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release',
`BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表';
# Dump of table instance
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Instance`;
CREATE TABLE `Instance` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`AppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name',
`Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`),
KEY `IX_IP` (`Ip`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例';
# Dump of table instanceconfig
# ------------------------------------------------------------
DROP TABLE IF EXISTS `InstanceConfig`;
CREATE TABLE `InstanceConfig` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id',
`ConfigAppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config App Id',
`ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name',
`ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name',
`ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
`ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`),
KEY `IX_ReleaseKey` (`ReleaseKey`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息';
# Dump of table item
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Item`;
CREATE TABLE `Item` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
`Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
`Value` longtext NOT NULL COMMENT '配置项值',
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
`LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_GroupId` (`NamespaceId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目';
# Dump of table namespace
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Namespace`;
CREATE TABLE `Namespace` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId_ClusterName_NamespaceName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_NamespaceName` (`NamespaceName`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间';
# Dump of table namespacelock
# ------------------------------------------------------------
DROP TABLE IF EXISTS `NamespaceLock`;
CREATE TABLE `NamespaceLock` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT 'default' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
`IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除',
PRIMARY KEY (`Id`),
UNIQUE KEY `IX_NamespaceId` (`NamespaceId`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁';
# Dump of table release
# ------------------------------------------------------------
DROP TABLE IF EXISTS `Release`;
CREATE TABLE `Release` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
`Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字',
`Comment` varchar(256) DEFAULT NULL COMMENT '发布说明',
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`Configurations` longtext NOT NULL COMMENT '发布配置',
`IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_ReleaseKey` (`ReleaseKey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布';
# Dump of table releasehistory
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ReleaseHistory`;
CREATE TABLE `ReleaseHistory` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`AppId` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'AppID',
`ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
`NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
`BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名',
`ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id',
`PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId',
`Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度',
`OperationContext` longtext NOT NULL COMMENT '发布上下文信息',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`),
KEY `IX_ReleaseId` (`ReleaseId`),
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史';
# Dump of table releasemessage
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ReleaseMessage`;
CREATE TABLE `ReleaseMessage` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容',
`DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `DataChange_LastTime` (`DataChange_LastTime`),
KEY `IX_Message` (`Message`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息';
# Dump of table serverconfig
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ServerConfig`;
CREATE TABLE `ServerConfig` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
`Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
`Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群',
`Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
`DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`Id`),
KEY `IX_Key` (`Key`),
KEY `DataChange_LastTime` (`DataChange_LastTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
# Config
# ------------------------------------------------------------
INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`)
VALUES
('eureka.service.url', 'default', 'http://localhost:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'),
('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'),
('item.key.length.limit', 'default', '128', 'item key 最大长度限制'),
('item.value.length.limit', 'default', '20000', 'item value最大长度限制'),
('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!');
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.controller;
import com.ctrip.framework.apollo.common.dto.AppNamespaceDTO;
import com.ctrip.framework.apollo.common.dto.NamespaceDTO;
import com.ctrip.framework.apollo.common.entity.AppNamespace;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.http.MultiResponseEntity;
import com.ctrip.framework.apollo.common.http.RichResponseEntity;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.common.utils.InputValidator;
import com.ctrip.framework.apollo.common.utils.RequestPrecondition;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.PermissionValidator;
import com.ctrip.framework.apollo.portal.component.config.PortalConfig;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.entity.model.NamespaceCreationModel;
import com.ctrip.framework.apollo.portal.listener.AppNamespaceCreationEvent;
import com.ctrip.framework.apollo.portal.listener.AppNamespaceDeletionEvent;
import com.ctrip.framework.apollo.portal.service.AppNamespaceService;
import com.ctrip.framework.apollo.portal.service.NamespaceService;
import com.ctrip.framework.apollo.portal.service.RoleInitializationService;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static com.ctrip.framework.apollo.common.utils.RequestPrecondition.checkModel;
@RestController
public class NamespaceController {
private static final Logger logger = LoggerFactory.getLogger(NamespaceController.class);
private final ApplicationEventPublisher publisher;
private final UserInfoHolder userInfoHolder;
private final NamespaceService namespaceService;
private final AppNamespaceService appNamespaceService;
private final RoleInitializationService roleInitializationService;
private final PortalConfig portalConfig;
private final PermissionValidator permissionValidator;
private final AdminServiceAPI.NamespaceAPI namespaceAPI;
public NamespaceController(
final ApplicationEventPublisher publisher,
final UserInfoHolder userInfoHolder,
final NamespaceService namespaceService,
final AppNamespaceService appNamespaceService,
final RoleInitializationService roleInitializationService,
final PortalConfig portalConfig,
final PermissionValidator permissionValidator,
final AdminServiceAPI.NamespaceAPI namespaceAPI) {
this.publisher = publisher;
this.userInfoHolder = userInfoHolder;
this.namespaceService = namespaceService;
this.appNamespaceService = appNamespaceService;
this.roleInitializationService = roleInitializationService;
this.portalConfig = portalConfig;
this.permissionValidator = permissionValidator;
this.namespaceAPI = namespaceAPI;
}
@GetMapping("/appnamespaces/public")
public List<AppNamespace> findPublicAppNamespaces() {
return appNamespaceService.findPublicAppNamespaces();
}
@GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces")
public List<NamespaceBO> findNamespaces(@PathVariable String appId, @PathVariable String env,
@PathVariable String clusterName) {
List<NamespaceBO> namespaceBOs = namespaceService.findNamespaceBOs(appId, Env.valueOf(env), clusterName);
for (NamespaceBO namespaceBO : namespaceBOs) {
if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceBO.getBaseInfo().getNamespaceName())) {
namespaceBO.hideItems();
}
}
return namespaceBOs;
}
@GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName:.+}")
public NamespaceBO findNamespace(@PathVariable String appId, @PathVariable String env,
@PathVariable String clusterName, @PathVariable String namespaceName) {
NamespaceBO namespaceBO = namespaceService.loadNamespaceBO(appId, Env.valueOf(env), clusterName, namespaceName);
if (namespaceBO != null && permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) {
namespaceBO.hideItems();
}
return namespaceBO;
}
@GetMapping("/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace")
public NamespaceBO findPublicNamespaceForAssociatedNamespace(@PathVariable String env,
@PathVariable String appId,
@PathVariable String namespaceName,
@PathVariable String clusterName) {
return namespaceService.findPublicNamespaceForAssociatedNamespace(Env.valueOf(env), appId, clusterName, namespaceName);
}
@PreAuthorize(value = "@permissionValidator.hasCreateNamespacePermission(#appId)")
@PostMapping("/apps/{appId}/namespaces")
public ResponseEntity<Void> createNamespace(@PathVariable String appId,
@RequestBody List<NamespaceCreationModel> models) {
checkModel(!CollectionUtils.isEmpty(models));
String namespaceName = models.get(0).getNamespace().getNamespaceName();
String operator = userInfoHolder.getUser().getUserId();
roleInitializationService.initNamespaceRoles(appId, namespaceName, operator);
roleInitializationService.initNamespaceEnvRoles(appId, namespaceName, operator);
for (NamespaceCreationModel model : models) {
NamespaceDTO namespace = model.getNamespace();
RequestPrecondition.checkArgumentsNotEmpty(model.getEnv(), namespace.getAppId(),
namespace.getClusterName(), namespace.getNamespaceName());
try {
namespaceService.createNamespace(Env.valueOf(model.getEnv()), namespace);
} catch (Exception e) {
logger.error("create namespace fail.", e);
Tracer.logError(
String.format("create namespace fail. (env=%s namespace=%s)", model.getEnv(),
namespace.getNamespaceName()), e);
}
}
namespaceService.assignNamespaceRoleToOperator(appId, namespaceName,userInfoHolder.getUser().getUserId());
return ResponseEntity.ok().build();
}
@PreAuthorize(value = "@permissionValidator.hasDeleteNamespacePermission(#appId)")
@DeleteMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName:.+}")
public ResponseEntity<Void> deleteNamespace(@PathVariable String appId, @PathVariable String env,
@PathVariable String clusterName, @PathVariable String namespaceName) {
namespaceService.deleteNamespace(appId, Env.valueOf(env), clusterName, namespaceName);
return ResponseEntity.ok().build();
}
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()")
@DeleteMapping("/apps/{appId}/appnamespaces/{namespaceName:.+}")
public ResponseEntity<Void> deleteAppNamespace(@PathVariable String appId, @PathVariable String namespaceName) {
AppNamespace appNamespace = appNamespaceService.deleteAppNamespace(appId, namespaceName);
publisher.publishEvent(new AppNamespaceDeletionEvent(appNamespace));
return ResponseEntity.ok().build();
}
@GetMapping("/apps/{appId}/appnamespaces/{namespaceName:.+}")
public AppNamespaceDTO findAppNamespace(@PathVariable String appId, @PathVariable String namespaceName) {
AppNamespace appNamespace = appNamespaceService.findByAppIdAndName(appId, namespaceName);
if (appNamespace == null) {
throw new BadRequestException(
String.format("AppNamespace not exists. AppId = %s, NamespaceName = %s", appId, namespaceName));
}
return BeanUtils.transform(AppNamespaceDTO.class, appNamespace);
}
@PreAuthorize(value = "@permissionValidator.hasCreateAppNamespacePermission(#appId, #appNamespace)")
@PostMapping("/apps/{appId}/appnamespaces")
public AppNamespace createAppNamespace(@PathVariable String appId,
@RequestParam(defaultValue = "true") boolean appendNamespacePrefix,
@Valid @RequestBody AppNamespace appNamespace) {
if (!InputValidator.isValidAppNamespace(appNamespace.getName())) {
throw new BadRequestException(String.format("Invalid Namespace format: %s",
InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & " + InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE));
}
AppNamespace createdAppNamespace = appNamespaceService.createAppNamespaceInLocal(appNamespace, appendNamespacePrefix);
if (portalConfig.canAppAdminCreatePrivateNamespace() || createdAppNamespace.isPublic()) {
namespaceService.assignNamespaceRoleToOperator(appId, appNamespace.getName(),
userInfoHolder.getUser().getUserId());
}
publisher.publishEvent(new AppNamespaceCreationEvent(createdAppNamespace));
return createdAppNamespace;
}
/**
* env -> cluster -> cluster has not published namespace?
* Example:
* dev ->
* default -> true (default cluster has not published namespace)
* customCluster -> false (customCluster cluster's all namespaces had published)
*/
@GetMapping("/apps/{appId}/namespaces/publish_info")
public Map<String, Map<String, Boolean>> getNamespacesPublishInfo(@PathVariable String appId) {
return namespaceService.getNamespacesPublishInfo(appId);
}
@GetMapping("/envs/{env}/appnamespaces/{publicNamespaceName}/namespaces")
public List<NamespaceDTO> getPublicAppNamespaceAllNamespaces(@PathVariable String env,
@PathVariable String publicNamespaceName,
@RequestParam(name = "page", defaultValue = "0") int page,
@RequestParam(name = "size", defaultValue = "10") int size) {
return namespaceService.getPublicAppNamespaceAllNamespaces(Env.valueOf(env), publicNamespaceName, page, size);
}
@GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces")
public MultiResponseEntity<String> findMissingNamespaces(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName) {
MultiResponseEntity<String> response = MultiResponseEntity.ok();
Set<String> missingNamespaces = findMissingNamespaceNames(appId, env, clusterName);
for (String missingNamespace : missingNamespaces) {
response.addResponseEntity(RichResponseEntity.ok(missingNamespace));
}
return response;
}
@PostMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces")
public ResponseEntity<Void> createMissingNamespaces(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName) {
Set<String> missingNamespaces = findMissingNamespaceNames(appId, env, clusterName);
for (String missingNamespace : missingNamespaces) {
namespaceAPI.createMissingAppNamespace(Env.valueOf(env), findAppNamespace(appId, missingNamespace));
}
return ResponseEntity.ok().build();
}
private Set<String> findMissingNamespaceNames(String appId, String env, String clusterName) {
List<AppNamespaceDTO> configDbAppNamespaces = namespaceAPI.getAppNamespaces(appId, Env.valueOf(env));
List<NamespaceDTO> configDbNamespaces = namespaceService.findNamespaces(appId, Env.valueOf(env), clusterName);
List<AppNamespace> portalDbAppNamespaces = appNamespaceService.findByAppId(appId);
Set<String> configDbAppNamespaceNames = configDbAppNamespaces.stream().map(AppNamespaceDTO::getName)
.collect(Collectors.toSet());
Set<String> configDbNamespaceNames = configDbNamespaces.stream().map(NamespaceDTO::getNamespaceName)
.collect(Collectors.toSet());
Set<String> portalDbAllAppNamespaceNames = Sets.newHashSet();
Set<String> portalDbPrivateAppNamespaceNames = Sets.newHashSet();
for (AppNamespace appNamespace : portalDbAppNamespaces) {
portalDbAllAppNamespaceNames.add(appNamespace.getName());
if (!appNamespace.isPublic()) {
portalDbPrivateAppNamespaceNames.add(appNamespace.getName());
}
}
// AppNamespaces should be the same
Set<String> missingAppNamespaceNames = Sets.difference(portalDbAllAppNamespaceNames, configDbAppNamespaceNames);
// Private namespaces should all exist
Set<String> missingNamespaceNames = Sets.difference(portalDbPrivateAppNamespaceNames, configDbNamespaceNames);
return Sets.union(missingAppNamespaceNames, missingNamespaceNames);
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.controller;
import com.ctrip.framework.apollo.common.dto.AppNamespaceDTO;
import com.ctrip.framework.apollo.common.dto.NamespaceDTO;
import com.ctrip.framework.apollo.common.entity.AppNamespace;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.http.MultiResponseEntity;
import com.ctrip.framework.apollo.common.http.RichResponseEntity;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.common.utils.InputValidator;
import com.ctrip.framework.apollo.common.utils.RequestPrecondition;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.PermissionValidator;
import com.ctrip.framework.apollo.portal.component.config.PortalConfig;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.entity.model.NamespaceCreationModel;
import com.ctrip.framework.apollo.portal.listener.AppNamespaceCreationEvent;
import com.ctrip.framework.apollo.portal.listener.AppNamespaceDeletionEvent;
import com.ctrip.framework.apollo.portal.service.AppNamespaceService;
import com.ctrip.framework.apollo.portal.service.NamespaceService;
import com.ctrip.framework.apollo.portal.service.RoleInitializationService;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.google.common.collect.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static com.ctrip.framework.apollo.common.utils.RequestPrecondition.checkModel;
@RestController
public class NamespaceController {
private static final Logger logger = LoggerFactory.getLogger(NamespaceController.class);
private final ApplicationEventPublisher publisher;
private final UserInfoHolder userInfoHolder;
private final NamespaceService namespaceService;
private final AppNamespaceService appNamespaceService;
private final RoleInitializationService roleInitializationService;
private final PortalConfig portalConfig;
private final PermissionValidator permissionValidator;
private final AdminServiceAPI.NamespaceAPI namespaceAPI;
public NamespaceController(
final ApplicationEventPublisher publisher,
final UserInfoHolder userInfoHolder,
final NamespaceService namespaceService,
final AppNamespaceService appNamespaceService,
final RoleInitializationService roleInitializationService,
final PortalConfig portalConfig,
final PermissionValidator permissionValidator,
final AdminServiceAPI.NamespaceAPI namespaceAPI) {
this.publisher = publisher;
this.userInfoHolder = userInfoHolder;
this.namespaceService = namespaceService;
this.appNamespaceService = appNamespaceService;
this.roleInitializationService = roleInitializationService;
this.portalConfig = portalConfig;
this.permissionValidator = permissionValidator;
this.namespaceAPI = namespaceAPI;
}
@GetMapping("/appnamespaces/public")
public List<AppNamespace> findPublicAppNamespaces() {
return appNamespaceService.findPublicAppNamespaces();
}
@GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces")
public List<NamespaceBO> findNamespaces(@PathVariable String appId, @PathVariable String env,
@PathVariable String clusterName) {
List<NamespaceBO> namespaceBOs = namespaceService.findNamespaceBOs(appId, Env.valueOf(env), clusterName);
for (NamespaceBO namespaceBO : namespaceBOs) {
if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceBO.getBaseInfo().getNamespaceName())) {
namespaceBO.hideItems();
}
}
return namespaceBOs;
}
@GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName:.+}")
public NamespaceBO findNamespace(@PathVariable String appId, @PathVariable String env,
@PathVariable String clusterName, @PathVariable String namespaceName) {
NamespaceBO namespaceBO = namespaceService.loadNamespaceBO(appId, Env.valueOf(env), clusterName, namespaceName);
if (namespaceBO != null && permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) {
namespaceBO.hideItems();
}
return namespaceBO;
}
@GetMapping("/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace")
public NamespaceBO findPublicNamespaceForAssociatedNamespace(@PathVariable String env,
@PathVariable String appId,
@PathVariable String namespaceName,
@PathVariable String clusterName) {
return namespaceService.findPublicNamespaceForAssociatedNamespace(Env.valueOf(env), appId, clusterName, namespaceName);
}
@PreAuthorize(value = "@permissionValidator.hasCreateNamespacePermission(#appId)")
@PostMapping("/apps/{appId}/namespaces")
public ResponseEntity<Void> createNamespace(@PathVariable String appId,
@RequestBody List<NamespaceCreationModel> models) {
checkModel(!CollectionUtils.isEmpty(models));
String namespaceName = models.get(0).getNamespace().getNamespaceName();
String operator = userInfoHolder.getUser().getUserId();
roleInitializationService.initNamespaceRoles(appId, namespaceName, operator);
roleInitializationService.initNamespaceEnvRoles(appId, namespaceName, operator);
for (NamespaceCreationModel model : models) {
NamespaceDTO namespace = model.getNamespace();
RequestPrecondition.checkArgumentsNotEmpty(model.getEnv(), namespace.getAppId(),
namespace.getClusterName(), namespace.getNamespaceName());
try {
namespaceService.createNamespace(Env.valueOf(model.getEnv()), namespace);
} catch (Exception e) {
logger.error("create namespace fail.", e);
Tracer.logError(
String.format("create namespace fail. (env=%s namespace=%s)", model.getEnv(),
namespace.getNamespaceName()), e);
}
}
namespaceService.assignNamespaceRoleToOperator(appId, namespaceName,userInfoHolder.getUser().getUserId());
return ResponseEntity.ok().build();
}
@PreAuthorize(value = "@permissionValidator.hasDeleteNamespacePermission(#appId)")
@DeleteMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName:.+}")
public ResponseEntity<Void> deleteNamespace(@PathVariable String appId, @PathVariable String env,
@PathVariable String clusterName, @PathVariable String namespaceName) {
namespaceService.deleteNamespace(appId, Env.valueOf(env), clusterName, namespaceName);
return ResponseEntity.ok().build();
}
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()")
@DeleteMapping("/apps/{appId}/appnamespaces/{namespaceName:.+}")
public ResponseEntity<Void> deleteAppNamespace(@PathVariable String appId, @PathVariable String namespaceName) {
AppNamespace appNamespace = appNamespaceService.deleteAppNamespace(appId, namespaceName);
publisher.publishEvent(new AppNamespaceDeletionEvent(appNamespace));
return ResponseEntity.ok().build();
}
@GetMapping("/apps/{appId}/appnamespaces/{namespaceName:.+}")
public AppNamespaceDTO findAppNamespace(@PathVariable String appId, @PathVariable String namespaceName) {
AppNamespace appNamespace = appNamespaceService.findByAppIdAndName(appId, namespaceName);
if (appNamespace == null) {
throw new BadRequestException(
String.format("AppNamespace not exists. AppId = %s, NamespaceName = %s", appId, namespaceName));
}
return BeanUtils.transform(AppNamespaceDTO.class, appNamespace);
}
@PreAuthorize(value = "@permissionValidator.hasCreateAppNamespacePermission(#appId, #appNamespace)")
@PostMapping("/apps/{appId}/appnamespaces")
public AppNamespace createAppNamespace(@PathVariable String appId,
@RequestParam(defaultValue = "true") boolean appendNamespacePrefix,
@Valid @RequestBody AppNamespace appNamespace) {
if (!InputValidator.isValidAppNamespace(appNamespace.getName())) {
throw new BadRequestException(String.format("Invalid Namespace format: %s",
InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & " + InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE));
}
AppNamespace createdAppNamespace = appNamespaceService.createAppNamespaceInLocal(appNamespace, appendNamespacePrefix);
if (portalConfig.canAppAdminCreatePrivateNamespace() || createdAppNamespace.isPublic()) {
namespaceService.assignNamespaceRoleToOperator(appId, appNamespace.getName(),
userInfoHolder.getUser().getUserId());
}
publisher.publishEvent(new AppNamespaceCreationEvent(createdAppNamespace));
return createdAppNamespace;
}
/**
* env -> cluster -> cluster has not published namespace?
* Example:
* dev ->
* default -> true (default cluster has not published namespace)
* customCluster -> false (customCluster cluster's all namespaces had published)
*/
@GetMapping("/apps/{appId}/namespaces/publish_info")
public Map<String, Map<String, Boolean>> getNamespacesPublishInfo(@PathVariable String appId) {
return namespaceService.getNamespacesPublishInfo(appId);
}
@GetMapping("/envs/{env}/appnamespaces/{publicNamespaceName}/namespaces")
public List<NamespaceDTO> getPublicAppNamespaceAllNamespaces(@PathVariable String env,
@PathVariable String publicNamespaceName,
@RequestParam(name = "page", defaultValue = "0") int page,
@RequestParam(name = "size", defaultValue = "10") int size) {
return namespaceService.getPublicAppNamespaceAllNamespaces(Env.valueOf(env), publicNamespaceName, page, size);
}
@GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces")
public MultiResponseEntity<String> findMissingNamespaces(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName) {
MultiResponseEntity<String> response = MultiResponseEntity.ok();
Set<String> missingNamespaces = findMissingNamespaceNames(appId, env, clusterName);
for (String missingNamespace : missingNamespaces) {
response.addResponseEntity(RichResponseEntity.ok(missingNamespace));
}
return response;
}
@PostMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces")
public ResponseEntity<Void> createMissingNamespaces(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName) {
Set<String> missingNamespaces = findMissingNamespaceNames(appId, env, clusterName);
for (String missingNamespace : missingNamespaces) {
namespaceAPI.createMissingAppNamespace(Env.valueOf(env), findAppNamespace(appId, missingNamespace));
}
return ResponseEntity.ok().build();
}
private Set<String> findMissingNamespaceNames(String appId, String env, String clusterName) {
List<AppNamespaceDTO> configDbAppNamespaces = namespaceAPI.getAppNamespaces(appId, Env.valueOf(env));
List<NamespaceDTO> configDbNamespaces = namespaceService.findNamespaces(appId, Env.valueOf(env), clusterName);
List<AppNamespace> portalDbAppNamespaces = appNamespaceService.findByAppId(appId);
Set<String> configDbAppNamespaceNames = configDbAppNamespaces.stream().map(AppNamespaceDTO::getName)
.collect(Collectors.toSet());
Set<String> configDbNamespaceNames = configDbNamespaces.stream().map(NamespaceDTO::getNamespaceName)
.collect(Collectors.toSet());
Set<String> portalDbAllAppNamespaceNames = Sets.newHashSet();
Set<String> portalDbPrivateAppNamespaceNames = Sets.newHashSet();
for (AppNamespace appNamespace : portalDbAppNamespaces) {
portalDbAllAppNamespaceNames.add(appNamespace.getName());
if (!appNamespace.isPublic()) {
portalDbPrivateAppNamespaceNames.add(appNamespace.getName());
}
}
// AppNamespaces should be the same
Set<String> missingAppNamespaceNames = Sets.difference(portalDbAllAppNamespaceNames, configDbAppNamespaceNames);
// Private namespaces should all exist
Set<String> missingNamespaceNames = Sets.difference(portalDbPrivateAppNamespaceNames, configDbNamespaceNames);
return Sets.union(missingAppNamespaceNames, missingNamespaceNames);
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/service/AccessKeyServiceTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.biz.service;
import static org.junit.Assert.assertNotNull;
import com.ctrip.framework.apollo.biz.AbstractIntegrationTest;
import com.ctrip.framework.apollo.biz.entity.AccessKey;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author nisiyong
*/
public class AccessKeyServiceTest extends AbstractIntegrationTest {
@Autowired
private AccessKeyService accessKeyService;
@Test
public void testCreate() {
String appId = "someAppId";
String secret = "someSecret";
AccessKey entity = assembleAccessKey(appId, secret);
AccessKey accessKey = accessKeyService.create(appId, entity);
assertNotNull(accessKey);
}
@Test(expected = BadRequestException.class)
public void testCreateWithException() {
String appId = "someAppId";
String secret = "someSecret";
int maxCount = 5;
for (int i = 0; i <= maxCount; i++) {
AccessKey entity = assembleAccessKey(appId, secret);
accessKeyService.create(appId, entity);
}
}
private AccessKey assembleAccessKey(String appId, String secret) {
AccessKey accessKey = new AccessKey();
accessKey.setAppId(appId);
accessKey.setSecret(secret);
return accessKey;
}
} | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.biz.service;
import static org.junit.Assert.assertNotNull;
import com.ctrip.framework.apollo.biz.AbstractIntegrationTest;
import com.ctrip.framework.apollo.biz.entity.AccessKey;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author nisiyong
*/
public class AccessKeyServiceTest extends AbstractIntegrationTest {
@Autowired
private AccessKeyService accessKeyService;
@Test
public void testCreate() {
String appId = "someAppId";
String secret = "someSecret";
AccessKey entity = assembleAccessKey(appId, secret);
AccessKey accessKey = accessKeyService.create(appId, entity);
assertNotNull(accessKey);
}
@Test(expected = BadRequestException.class)
public void testCreateWithException() {
String appId = "someAppId";
String secret = "someSecret";
int maxCount = 5;
for (int i = 0; i <= maxCount; i++) {
AccessKey entity = assembleAccessKey(appId, secret);
accessKeyService.create(appId, entity);
}
}
private AccessKey assembleAccessKey(String appId, String secret) {
AccessKey accessKey = new AccessKey();
accessKey.setAppId(appId);
accessKey.setSecret(secret);
return accessKey;
}
} | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-openapi/src/test/java/com/ctrip/framework/apollo/openapi/client/service/ClusterOpenApiServiceTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.openapi.client.service;
import static org.junit.Assert.*;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.util.EntityUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
public class ClusterOpenApiServiceTest extends AbstractOpenApiServiceTest {
private ClusterOpenApiService clusterOpenApiService;
private String someAppId;
private String someEnv;
@Before
public void setUp() throws Exception {
super.setUp();
someAppId = "someAppId";
someEnv = "someEnv";
StringEntity responseEntity = new StringEntity("{}");
when(someHttpResponse.getEntity()).thenReturn(responseEntity);
clusterOpenApiService = new ClusterOpenApiService(httpClient, someBaseUrl, gson);
}
@Test
public void testGetCluster() throws Exception {
String someCluster = "someCluster";
final ArgumentCaptor<HttpGet> request = ArgumentCaptor.forClass(HttpGet.class);
clusterOpenApiService.getCluster(someAppId, someEnv, someCluster);
verify(httpClient, times(1)).execute(request.capture());
HttpGet get = request.getValue();
assertEquals(String
.format("%s/envs/%s/apps/%s/clusters/%s", someBaseUrl, someEnv, someAppId, someCluster),
get.getURI().toString());
}
@Test(expected = RuntimeException.class)
public void testGetClusterWithError() throws Exception {
String someCluster = "someCluster";
when(statusLine.getStatusCode()).thenReturn(404);
clusterOpenApiService.getCluster(someAppId, someEnv, someCluster);
}
@Test
public void testCreateCluster() throws Exception {
String someCluster = "someCluster";
String someCreatedBy = "someCreatedBy";
OpenClusterDTO clusterDTO = new OpenClusterDTO();
clusterDTO.setAppId(someAppId);
clusterDTO.setName(someCluster);
clusterDTO.setDataChangeCreatedBy(someCreatedBy);
final ArgumentCaptor<HttpPost> request = ArgumentCaptor.forClass(HttpPost.class);
clusterOpenApiService.createCluster(someEnv, clusterDTO);
verify(httpClient, times(1)).execute(request.capture());
HttpPost post = request.getValue();
assertEquals(String
.format("%s/envs/%s/apps/%s/clusters", someBaseUrl, someEnv, someAppId), post.getURI().toString());
StringEntity entity = (StringEntity) post.getEntity();
assertEquals(ContentType.APPLICATION_JSON.toString(), entity.getContentType().getValue());
assertEquals(gson.toJson(clusterDTO), EntityUtils.toString(entity));
}
@Test(expected = RuntimeException.class)
public void testCreateClusterWithError() throws Exception {
String someCluster = "someCluster";
String someCreatedBy = "someCreatedBy";
OpenClusterDTO clusterDTO = new OpenClusterDTO();
clusterDTO.setAppId(someAppId);
clusterDTO.setName(someCluster);
clusterDTO.setDataChangeCreatedBy(someCreatedBy);
when(statusLine.getStatusCode()).thenReturn(400);
clusterOpenApiService.createCluster(someEnv, clusterDTO);
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.openapi.client.service;
import static org.junit.Assert.*;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.util.EntityUtils;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
public class ClusterOpenApiServiceTest extends AbstractOpenApiServiceTest {
private ClusterOpenApiService clusterOpenApiService;
private String someAppId;
private String someEnv;
@Before
public void setUp() throws Exception {
super.setUp();
someAppId = "someAppId";
someEnv = "someEnv";
StringEntity responseEntity = new StringEntity("{}");
when(someHttpResponse.getEntity()).thenReturn(responseEntity);
clusterOpenApiService = new ClusterOpenApiService(httpClient, someBaseUrl, gson);
}
@Test
public void testGetCluster() throws Exception {
String someCluster = "someCluster";
final ArgumentCaptor<HttpGet> request = ArgumentCaptor.forClass(HttpGet.class);
clusterOpenApiService.getCluster(someAppId, someEnv, someCluster);
verify(httpClient, times(1)).execute(request.capture());
HttpGet get = request.getValue();
assertEquals(String
.format("%s/envs/%s/apps/%s/clusters/%s", someBaseUrl, someEnv, someAppId, someCluster),
get.getURI().toString());
}
@Test(expected = RuntimeException.class)
public void testGetClusterWithError() throws Exception {
String someCluster = "someCluster";
when(statusLine.getStatusCode()).thenReturn(404);
clusterOpenApiService.getCluster(someAppId, someEnv, someCluster);
}
@Test
public void testCreateCluster() throws Exception {
String someCluster = "someCluster";
String someCreatedBy = "someCreatedBy";
OpenClusterDTO clusterDTO = new OpenClusterDTO();
clusterDTO.setAppId(someAppId);
clusterDTO.setName(someCluster);
clusterDTO.setDataChangeCreatedBy(someCreatedBy);
final ArgumentCaptor<HttpPost> request = ArgumentCaptor.forClass(HttpPost.class);
clusterOpenApiService.createCluster(someEnv, clusterDTO);
verify(httpClient, times(1)).execute(request.capture());
HttpPost post = request.getValue();
assertEquals(String
.format("%s/envs/%s/apps/%s/clusters", someBaseUrl, someEnv, someAppId), post.getURI().toString());
StringEntity entity = (StringEntity) post.getEntity();
assertEquals(ContentType.APPLICATION_JSON.toString(), entity.getContentType().getValue());
assertEquals(gson.toJson(clusterDTO), EntityUtils.toString(entity));
}
@Test(expected = RuntimeException.class)
public void testCreateClusterWithError() throws Exception {
String someCluster = "someCluster";
String someCreatedBy = "someCreatedBy";
OpenClusterDTO clusterDTO = new OpenClusterDTO();
clusterDTO.setAppId(someAppId);
clusterDTO.setName(someCluster);
clusterDTO.setDataChangeCreatedBy(someCreatedBy);
when(statusLine.getStatusCode()).thenReturn(400);
clusterOpenApiService.createCluster(someEnv, clusterDTO);
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-assembly/src/test/java/com/ctrip/framework/apollo/assembly/LocalApolloApplication.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.assembly;
import com.ctrip.framework.apollo.adminservice.AdminServiceApplication;
import com.ctrip.framework.apollo.configservice.ConfigServiceApplication;
import com.ctrip.framework.apollo.portal.PortalApplication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.context.scope.refresh.RefreshScope;
import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class})
public class LocalApolloApplication {
private static final Logger logger = LoggerFactory.getLogger(ApolloApplication.class);
public static void main(String[] args) throws Exception {
/**
* Common
*/
ConfigurableApplicationContext commonContext =
new SpringApplicationBuilder(ApolloApplication.class).web(WebApplicationType.NONE).run(args);
logger.info(commonContext.getId() + " isActive: " + commonContext.isActive());
/**
* ConfigService
*/
if (commonContext.getEnvironment().containsProperty("configservice")) {
ConfigurableApplicationContext configContext =
new SpringApplicationBuilder(ConfigServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(configContext.getId() + " isActive: " + configContext.isActive());
}
/**
* AdminService
*/
if (commonContext.getEnvironment().containsProperty("adminservice")) {
ConfigurableApplicationContext adminContext =
new SpringApplicationBuilder(AdminServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(adminContext.getId() + " isActive: " + adminContext.isActive());
}
/**
* Portal
*/
if (commonContext.getEnvironment().containsProperty("portal")) {
ConfigurableApplicationContext portalContext =
new SpringApplicationBuilder(PortalApplication.class).parent(commonContext).run(args);
logger.info(portalContext.getId() + " isActive: " + portalContext.isActive());
}
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.assembly;
import com.ctrip.framework.apollo.adminservice.AdminServiceApplication;
import com.ctrip.framework.apollo.configservice.ConfigServiceApplication;
import com.ctrip.framework.apollo.portal.PortalApplication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.context.scope.refresh.RefreshScope;
import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class})
public class LocalApolloApplication {
private static final Logger logger = LoggerFactory.getLogger(ApolloApplication.class);
public static void main(String[] args) throws Exception {
/**
* Common
*/
ConfigurableApplicationContext commonContext =
new SpringApplicationBuilder(ApolloApplication.class).web(WebApplicationType.NONE).run(args);
logger.info(commonContext.getId() + " isActive: " + commonContext.isActive());
/**
* ConfigService
*/
if (commonContext.getEnvironment().containsProperty("configservice")) {
ConfigurableApplicationContext configContext =
new SpringApplicationBuilder(ConfigServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(configContext.getId() + " isActive: " + configContext.isActive());
}
/**
* AdminService
*/
if (commonContext.getEnvironment().containsProperty("adminservice")) {
ConfigurableApplicationContext adminContext =
new SpringApplicationBuilder(AdminServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(adminContext.getId() + " isActive: " + adminContext.isActive());
}
/**
* Portal
*/
if (commonContext.getEnvironment().containsProperty("portal")) {
ConfigurableApplicationContext portalContext =
new SpringApplicationBuilder(PortalApplication.class).parent(commonContext).run(args);
logger.info(portalContext.getId() + " isActive: " + portalContext.isActive());
}
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/apollo-on-kubernetes/apollo-admin-server/config/app.properties | #
# Copyright 2021 Apollo Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
appId=100003172
jdkVersion=1.8
| #
# Copyright 2021 Apollo Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
appId=100003172
jdkVersion=1.8
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/main/resources/META-INF/services/com.ctrip.framework.apollo.spring.spi.ConfigPropertySourcesProcessorHelper | com.ctrip.framework.apollo.spring.spi.DefaultConfigPropertySourcesProcessorHelper
| com.ctrip.framework.apollo.spring.spi.DefaultConfigPropertySourcesProcessorHelper
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-core/src/test/java/com/ctrip/framework/apollo/tracer/internals/MockMessageProducerManager.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.tracer.internals;
import com.ctrip.framework.apollo.tracer.spi.MessageProducer;
import com.ctrip.framework.apollo.tracer.spi.MessageProducerManager;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class MockMessageProducerManager implements MessageProducerManager {
private static MessageProducer s_producer;
@Override
public MessageProducer getProducer() {
return s_producer;
}
public static void setProducer(MessageProducer producer) {
s_producer = producer;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.tracer.internals;
import com.ctrip.framework.apollo.tracer.spi.MessageProducer;
import com.ctrip.framework.apollo.tracer.spi.MessageProducerManager;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class MockMessageProducerManager implements MessageProducerManager {
private static MessageProducer s_producer;
@Override
public MessageProducer getProducer() {
return s_producer;
}
public static void setProducer(MessageProducer producer) {
s_producer = producer;
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-admin-server-dev.yaml | #
# Copyright 2021 Apollo Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
# configmap for apollo-admin-server-dev
kind: ConfigMap
apiVersion: v1
metadata:
namespace: sre
name: configmap-apollo-admin-server-dev
data:
application-github.properties: |
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/DevApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/
---
kind: Service
apiVersion: v1
metadata:
namespace: sre
name: service-apollo-admin-server-dev
labels:
app: service-apollo-admin-server-dev
spec:
ports:
- protocol: TCP
port: 8090
targetPort: 8090
selector:
app: pod-apollo-admin-server-dev
type: ClusterIP
sessionAffinity: ClientIP
---
kind: Deployment
apiVersion: apps/v1
metadata:
namespace: sre
name: deployment-apollo-admin-server-dev
labels:
app: deployment-apollo-admin-server-dev
spec:
replicas: 3
selector:
matchLabels:
app: pod-apollo-admin-server-dev
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: pod-apollo-admin-server-dev
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- pod-apollo-admin-server-dev
topologyKey: kubernetes.io/hostname
volumes:
- name: volume-configmap-apollo-admin-server-dev
configMap:
name: configmap-apollo-admin-server-dev
items:
- key: application-github.properties
path: application-github.properties
initContainers:
- image: alpine-bash:3.8
name: check-service-apollo-config-server-dev
command: ['bash', '-c', "curl --connect-timeout 2 --max-time 5 --retry 60 --retry-delay 1 --retry-max-time 120 service-apollo-config-server-dev.sre:8080"]
containers:
- image: apollo-admin-server:v1.0.0
securityContext:
privileged: true
imagePullPolicy: IfNotPresent
name: container-apollo-admin-server-dev
ports:
- protocol: TCP
containerPort: 8090
volumeMounts:
- name: volume-configmap-apollo-admin-server-dev
mountPath: /apollo-admin-server/config/application-github.properties
subPath: application-github.properties
env:
- name: APOLLO_ADMIN_SERVICE_NAME
value: "service-apollo-admin-server-dev.sre"
readinessProbe:
tcpSocket:
port: 8090
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
tcpSocket:
port: 8090
initialDelaySeconds: 120
periodSeconds: 10
dnsPolicy: ClusterFirst
restartPolicy: Always | #
# Copyright 2021 Apollo Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
# configmap for apollo-admin-server-dev
kind: ConfigMap
apiVersion: v1
metadata:
namespace: sre
name: configmap-apollo-admin-server-dev
data:
application-github.properties: |
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/DevApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/
---
kind: Service
apiVersion: v1
metadata:
namespace: sre
name: service-apollo-admin-server-dev
labels:
app: service-apollo-admin-server-dev
spec:
ports:
- protocol: TCP
port: 8090
targetPort: 8090
selector:
app: pod-apollo-admin-server-dev
type: ClusterIP
sessionAffinity: ClientIP
---
kind: Deployment
apiVersion: apps/v1
metadata:
namespace: sre
name: deployment-apollo-admin-server-dev
labels:
app: deployment-apollo-admin-server-dev
spec:
replicas: 3
selector:
matchLabels:
app: pod-apollo-admin-server-dev
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: pod-apollo-admin-server-dev
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- pod-apollo-admin-server-dev
topologyKey: kubernetes.io/hostname
volumes:
- name: volume-configmap-apollo-admin-server-dev
configMap:
name: configmap-apollo-admin-server-dev
items:
- key: application-github.properties
path: application-github.properties
initContainers:
- image: alpine-bash:3.8
name: check-service-apollo-config-server-dev
command: ['bash', '-c', "curl --connect-timeout 2 --max-time 5 --retry 60 --retry-delay 1 --retry-max-time 120 service-apollo-config-server-dev.sre:8080"]
containers:
- image: apollo-admin-server:v1.0.0
securityContext:
privileged: true
imagePullPolicy: IfNotPresent
name: container-apollo-admin-server-dev
ports:
- protocol: TCP
containerPort: 8090
volumeMounts:
- name: volume-configmap-apollo-admin-server-dev
mountPath: /apollo-admin-server/config/application-github.properties
subPath: application-github.properties
env:
- name: APOLLO_ADMIN_SERVICE_NAME
value: "service-apollo-admin-server-dev.sre"
readinessProbe:
tcpSocket:
port: 8090
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
tcpSocket:
port: 8090
initialDelaySeconds: 120
periodSeconds: 10
dnsPolicy: ClusterFirst
restartPolicy: Always | -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/condition/OnProfileCondition.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.condition;
import com.google.common.collect.Sets;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.util.MultiValueMap;
import java.util.Collections;
import java.util.List;
import java.util.Set;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class OnProfileCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
Set<String> activeProfiles = Sets.newHashSet(context.getEnvironment().getActiveProfiles());
Set<String> requiredActiveProfiles = retrieveAnnotatedProfiles(metadata, ConditionalOnProfile.class.getName());
Set<String> requiredInactiveProfiles = retrieveAnnotatedProfiles(metadata, ConditionalOnMissingProfile.class
.getName());
return Sets.difference(requiredActiveProfiles, activeProfiles).isEmpty()
&& Sets.intersection(requiredInactiveProfiles, activeProfiles).isEmpty();
}
private Set<String> retrieveAnnotatedProfiles(AnnotatedTypeMetadata metadata, String annotationType) {
if (!metadata.isAnnotated(annotationType)) {
return Collections.emptySet();
}
MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(annotationType);
if (attributes == null) {
return Collections.emptySet();
}
Set<String> profiles = Sets.newHashSet();
List<?> values = attributes.get("value");
if (values != null) {
for (Object value : values) {
if (value instanceof String[]) {
Collections.addAll(profiles, (String[]) value);
}
else {
profiles.add((String) value);
}
}
}
return profiles;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.condition;
import com.google.common.collect.Sets;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.util.MultiValueMap;
import java.util.Collections;
import java.util.List;
import java.util.Set;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class OnProfileCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
Set<String> activeProfiles = Sets.newHashSet(context.getEnvironment().getActiveProfiles());
Set<String> requiredActiveProfiles = retrieveAnnotatedProfiles(metadata, ConditionalOnProfile.class.getName());
Set<String> requiredInactiveProfiles = retrieveAnnotatedProfiles(metadata, ConditionalOnMissingProfile.class
.getName());
return Sets.difference(requiredActiveProfiles, activeProfiles).isEmpty()
&& Sets.intersection(requiredInactiveProfiles, activeProfiles).isEmpty();
}
private Set<String> retrieveAnnotatedProfiles(AnnotatedTypeMetadata metadata, String annotationType) {
if (!metadata.isAnnotated(annotationType)) {
return Collections.emptySet();
}
MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(annotationType);
if (attributes == null) {
return Collections.emptySet();
}
Set<String> profiles = Sets.newHashSet();
List<?> values = attributes.get("value");
if (values != null) {
for (Object value : values) {
if (value instanceof String[]) {
Collections.addAll(profiles, (String[]) value);
}
else {
profiles.add((String) value);
}
}
}
return profiles;
}
}
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-client</artifactId>
<name>Apollo Client</name>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencyManagement>
<dependencies>
<!-- Spring Boot 2 requires Java 8, so we need to manually stick to 1.5.x version in order to compile apollo-client against Java 7 -->
<!-- This is only for apollo-client compilation use, because optional Spring dependencies are not transitive -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.16.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- apollo -->
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-core</artifactId>
</dependency>
<!-- end of apollo -->
<!-- guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<!-- end of guice -->
<!-- log -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- yml processing -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<!-- end of yml processing -->
<!-- optional spring dependency -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<optional>true</optional>
</dependency>
<!-- optional spring boot dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!-- test -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<!-- end of test -->
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 Apollo Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-client</artifactId>
<name>Apollo Client</name>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencyManagement>
<dependencies>
<!-- Spring Boot 2 requires Java 8, so we need to manually stick to 1.5.x version in order to compile apollo-client against Java 7 -->
<!-- This is only for apollo-client compilation use, because optional Spring dependencies are not transitive -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.16.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- apollo -->
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-core</artifactId>
</dependency>
<!-- end of apollo -->
<!-- guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<!-- end of guice -->
<!-- log -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- yml processing -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<!-- end of yml processing -->
<!-- optional spring dependency -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<optional>true</optional>
</dependency>
<!-- optional spring boot dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!-- test -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<!-- end of test -->
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,713 | add apollo team introduction and community releated contents | ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | 2021-05-26T10:05:24Z | 2021-05-28T05:38:22Z | 4e1a5c13d784c5d80ba3b36b6ce169bd3f547e0e | b4893914af3a6a3754c2d5685ae2ec9fb23119c2 | add apollo team introduction and community releated contents. ## What's the purpose of this PR
add apollo team introduction and community releated contents
Reference issues: #3684 #3705 #3706 #3707 #3708 #3709
## Brief changelog
1. add team introduction page
2. add links to community governance
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-core/src/test/java/com/ctrip/framework/apollo/core/utils/NetUtilTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.core.utils;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.ctrip.framework.apollo.BaseIntegrationTest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.junit.Test;
/**
* Created by gl49 on 2018/6/8.
*/
public class NetUtilTest extends BaseIntegrationTest {
@Test
public void testPingUrlWithStatusCode200() throws Exception {
String someResponse = "some response";
ContextHandler handler = mockServerHandler(HttpServletResponse.SC_OK, someResponse);
startServerWithHandlers(handler);
assertTrue(NetUtil.pingUrl("http://localhost:" + PORT));
}
@Test
public void testPingUrlWithStatusCode404() throws Exception {
String someResponse = "some response";
startServerWithHandlers(mockServerHandler(HttpServletResponse.SC_NOT_FOUND, someResponse));
assertFalse(NetUtil.pingUrl("http://localhost:" + PORT));
}
@Test
public void testPingUrlWithServerNotStarted() throws Exception {
assertFalse(NetUtil.pingUrl("http://localhost:" + PORT));
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.core.utils;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.ctrip.framework.apollo.BaseIntegrationTest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.junit.Test;
/**
* Created by gl49 on 2018/6/8.
*/
public class NetUtilTest extends BaseIntegrationTest {
@Test
public void testPingUrlWithStatusCode200() throws Exception {
String someResponse = "some response";
ContextHandler handler = mockServerHandler(HttpServletResponse.SC_OK, someResponse);
startServerWithHandlers(handler);
assertTrue(NetUtil.pingUrl("http://localhost:" + PORT));
}
@Test
public void testPingUrlWithStatusCode404() throws Exception {
String someResponse = "some response";
startServerWithHandlers(mockServerHandler(HttpServletResponse.SC_NOT_FOUND, someResponse));
assertFalse(NetUtil.pingUrl("http://localhost:" + PORT));
}
@Test
public void testPingUrlWithServerNotStarted() throws Exception {
assertFalse(NetUtil.pingUrl("http://localhost:" + PORT));
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.internals;
import com.ctrip.framework.apollo.enums.ConfigSourceType;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ctrip.framework.apollo.build.ApolloInjector;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil;
import com.ctrip.framework.apollo.exceptions.ApolloConfigException;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.ctrip.framework.apollo.tracer.spi.Transaction;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.ctrip.framework.apollo.util.ExceptionUtil;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class LocalFileConfigRepository extends AbstractConfigRepository
implements RepositoryChangeListener {
private static final Logger logger = LoggerFactory.getLogger(LocalFileConfigRepository.class);
private static final String CONFIG_DIR = "/config-cache";
private final String m_namespace;
private File m_baseDir;
private final ConfigUtil m_configUtil;
private volatile Properties m_fileProperties;
private volatile ConfigRepository m_upstream;
private volatile ConfigSourceType m_sourceType = ConfigSourceType.LOCAL;
/**
* Constructor.
*
* @param namespace the namespace
*/
public LocalFileConfigRepository(String namespace) {
this(namespace, null);
}
public LocalFileConfigRepository(String namespace, ConfigRepository upstream) {
m_namespace = namespace;
m_configUtil = ApolloInjector.getInstance(ConfigUtil.class);
this.setLocalCacheDir(findLocalCacheDir(), false);
this.setUpstreamRepository(upstream);
this.trySync();
}
void setLocalCacheDir(File baseDir, boolean syncImmediately) {
m_baseDir = baseDir;
this.checkLocalConfigCacheDir(m_baseDir);
if (syncImmediately) {
this.trySync();
}
}
private File findLocalCacheDir() {
try {
String defaultCacheDir = m_configUtil.getDefaultLocalCacheDir();
Path path = Paths.get(defaultCacheDir);
if (!Files.exists(path)) {
Files.createDirectories(path);
}
if (Files.exists(path) && Files.isWritable(path)) {
return new File(defaultCacheDir, CONFIG_DIR);
}
} catch (Throwable ex) {
//ignore
}
return new File(ClassLoaderUtil.getClassPath(), CONFIG_DIR);
}
@Override
public Properties getConfig() {
if (m_fileProperties == null) {
sync();
}
Properties result = propertiesFactory.getPropertiesInstance();
result.putAll(m_fileProperties);
return result;
}
@Override
public void setUpstreamRepository(ConfigRepository upstreamConfigRepository) {
if (upstreamConfigRepository == null) {
return;
}
//clear previous listener
if (m_upstream != null) {
m_upstream.removeChangeListener(this);
}
m_upstream = upstreamConfigRepository;
trySyncFromUpstream();
upstreamConfigRepository.addChangeListener(this);
}
@Override
public ConfigSourceType getSourceType() {
return m_sourceType;
}
@Override
public void onRepositoryChange(String namespace, Properties newProperties) {
if (newProperties.equals(m_fileProperties)) {
return;
}
Properties newFileProperties = propertiesFactory.getPropertiesInstance();
newFileProperties.putAll(newProperties);
updateFileProperties(newFileProperties, m_upstream.getSourceType());
this.fireRepositoryChange(namespace, newProperties);
}
@Override
protected void sync() {
//sync with upstream immediately
boolean syncFromUpstreamResultSuccess = trySyncFromUpstream();
if (syncFromUpstreamResultSuccess) {
return;
}
Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "syncLocalConfig");
Throwable exception = null;
try {
transaction.addData("Basedir", m_baseDir.getAbsolutePath());
m_fileProperties = this.loadFromLocalCacheFile(m_baseDir, m_namespace);
m_sourceType = ConfigSourceType.LOCAL;
transaction.setStatus(Transaction.SUCCESS);
} catch (Throwable ex) {
Tracer.logEvent("ApolloConfigException", ExceptionUtil.getDetailMessage(ex));
transaction.setStatus(ex);
exception = ex;
//ignore
} finally {
transaction.complete();
}
if (m_fileProperties == null) {
m_sourceType = ConfigSourceType.NONE;
throw new ApolloConfigException(
"Load config from local config failed!", exception);
}
}
private boolean trySyncFromUpstream() {
if (m_upstream == null) {
return false;
}
try {
updateFileProperties(m_upstream.getConfig(), m_upstream.getSourceType());
return true;
} catch (Throwable ex) {
Tracer.logError(ex);
logger
.warn("Sync config from upstream repository {} failed, reason: {}", m_upstream.getClass(),
ExceptionUtil.getDetailMessage(ex));
}
return false;
}
private synchronized void updateFileProperties(Properties newProperties, ConfigSourceType sourceType) {
this.m_sourceType = sourceType;
if (newProperties.equals(m_fileProperties)) {
return;
}
this.m_fileProperties = newProperties;
persistLocalCacheFile(m_baseDir, m_namespace);
}
private Properties loadFromLocalCacheFile(File baseDir, String namespace) throws IOException {
Preconditions.checkNotNull(baseDir, "Basedir cannot be null");
File file = assembleLocalCacheFile(baseDir, namespace);
Properties properties = null;
if (file.isFile() && file.canRead()) {
InputStream in = null;
try {
in = new FileInputStream(file);
properties = propertiesFactory.getPropertiesInstance();
properties.load(in);
logger.debug("Loading local config file {} successfully!", file.getAbsolutePath());
} catch (IOException ex) {
Tracer.logError(ex);
throw new ApolloConfigException(String
.format("Loading config from local cache file %s failed", file.getAbsolutePath()), ex);
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException ex) {
// ignore
}
}
} else {
throw new ApolloConfigException(
String.format("Cannot read from local cache file %s", file.getAbsolutePath()));
}
return properties;
}
void persistLocalCacheFile(File baseDir, String namespace) {
if (baseDir == null) {
return;
}
File file = assembleLocalCacheFile(baseDir, namespace);
OutputStream out = null;
Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "persistLocalConfigFile");
transaction.addData("LocalConfigFile", file.getAbsolutePath());
try {
out = new FileOutputStream(file);
m_fileProperties.store(out, "Persisted by DefaultConfig");
transaction.setStatus(Transaction.SUCCESS);
} catch (IOException ex) {
ApolloConfigException exception =
new ApolloConfigException(
String.format("Persist local cache file %s failed", file.getAbsolutePath()), ex);
Tracer.logError(exception);
transaction.setStatus(exception);
logger.warn("Persist local cache file {} failed, reason: {}.", file.getAbsolutePath(),
ExceptionUtil.getDetailMessage(ex));
} finally {
if (out != null) {
try {
out.close();
} catch (IOException ex) {
//ignore
}
}
transaction.complete();
}
}
private void checkLocalConfigCacheDir(File baseDir) {
if (baseDir.exists()) {
return;
}
Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "createLocalConfigDir");
transaction.addData("BaseDir", baseDir.getAbsolutePath());
try {
Files.createDirectory(baseDir.toPath());
transaction.setStatus(Transaction.SUCCESS);
} catch (IOException ex) {
ApolloConfigException exception =
new ApolloConfigException(
String.format("Create local config directory %s failed", baseDir.getAbsolutePath()),
ex);
Tracer.logError(exception);
transaction.setStatus(exception);
logger.warn(
"Unable to create local config cache directory {}, reason: {}. Will not able to cache config file.",
baseDir.getAbsolutePath(), ExceptionUtil.getDetailMessage(ex));
} finally {
transaction.complete();
}
}
File assembleLocalCacheFile(File baseDir, String namespace) {
String fileName =
String.format("%s.properties", Joiner.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR)
.join(m_configUtil.getAppId(), m_configUtil.getCluster(), namespace));
return new File(baseDir, fileName);
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.internals;
import com.ctrip.framework.apollo.enums.ConfigSourceType;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ctrip.framework.apollo.build.ApolloInjector;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.utils.ClassLoaderUtil;
import com.ctrip.framework.apollo.exceptions.ApolloConfigException;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.ctrip.framework.apollo.tracer.spi.Transaction;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.ctrip.framework.apollo.util.ExceptionUtil;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class LocalFileConfigRepository extends AbstractConfigRepository
implements RepositoryChangeListener {
private static final Logger logger = LoggerFactory.getLogger(LocalFileConfigRepository.class);
private static final String CONFIG_DIR = "/config-cache";
private final String m_namespace;
private File m_baseDir;
private final ConfigUtil m_configUtil;
private volatile Properties m_fileProperties;
private volatile ConfigRepository m_upstream;
private volatile ConfigSourceType m_sourceType = ConfigSourceType.LOCAL;
/**
* Constructor.
*
* @param namespace the namespace
*/
public LocalFileConfigRepository(String namespace) {
this(namespace, null);
}
public LocalFileConfigRepository(String namespace, ConfigRepository upstream) {
m_namespace = namespace;
m_configUtil = ApolloInjector.getInstance(ConfigUtil.class);
this.setLocalCacheDir(findLocalCacheDir(), false);
this.setUpstreamRepository(upstream);
this.trySync();
}
void setLocalCacheDir(File baseDir, boolean syncImmediately) {
m_baseDir = baseDir;
this.checkLocalConfigCacheDir(m_baseDir);
if (syncImmediately) {
this.trySync();
}
}
private File findLocalCacheDir() {
try {
String defaultCacheDir = m_configUtil.getDefaultLocalCacheDir();
Path path = Paths.get(defaultCacheDir);
if (!Files.exists(path)) {
Files.createDirectories(path);
}
if (Files.exists(path) && Files.isWritable(path)) {
return new File(defaultCacheDir, CONFIG_DIR);
}
} catch (Throwable ex) {
//ignore
}
return new File(ClassLoaderUtil.getClassPath(), CONFIG_DIR);
}
@Override
public Properties getConfig() {
if (m_fileProperties == null) {
sync();
}
Properties result = propertiesFactory.getPropertiesInstance();
result.putAll(m_fileProperties);
return result;
}
@Override
public void setUpstreamRepository(ConfigRepository upstreamConfigRepository) {
if (upstreamConfigRepository == null) {
return;
}
//clear previous listener
if (m_upstream != null) {
m_upstream.removeChangeListener(this);
}
m_upstream = upstreamConfigRepository;
upstreamConfigRepository.addChangeListener(this);
}
@Override
public ConfigSourceType getSourceType() {
return m_sourceType;
}
@Override
public void onRepositoryChange(String namespace, Properties newProperties) {
if (newProperties.equals(m_fileProperties)) {
return;
}
Properties newFileProperties = propertiesFactory.getPropertiesInstance();
newFileProperties.putAll(newProperties);
updateFileProperties(newFileProperties, m_upstream.getSourceType());
this.fireRepositoryChange(namespace, newProperties);
}
@Override
protected void sync() {
//sync with upstream immediately
boolean syncFromUpstreamResultSuccess = trySyncFromUpstream();
if (syncFromUpstreamResultSuccess) {
return;
}
Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "syncLocalConfig");
Throwable exception = null;
try {
transaction.addData("Basedir", m_baseDir.getAbsolutePath());
m_fileProperties = this.loadFromLocalCacheFile(m_baseDir, m_namespace);
m_sourceType = ConfigSourceType.LOCAL;
transaction.setStatus(Transaction.SUCCESS);
} catch (Throwable ex) {
Tracer.logEvent("ApolloConfigException", ExceptionUtil.getDetailMessage(ex));
transaction.setStatus(ex);
exception = ex;
//ignore
} finally {
transaction.complete();
}
if (m_fileProperties == null) {
m_sourceType = ConfigSourceType.NONE;
throw new ApolloConfigException(
"Load config from local config failed!", exception);
}
}
private boolean trySyncFromUpstream() {
if (m_upstream == null) {
return false;
}
try {
updateFileProperties(m_upstream.getConfig(), m_upstream.getSourceType());
return true;
} catch (Throwable ex) {
Tracer.logError(ex);
logger
.warn("Sync config from upstream repository {} failed, reason: {}", m_upstream.getClass(),
ExceptionUtil.getDetailMessage(ex));
}
return false;
}
private synchronized void updateFileProperties(Properties newProperties, ConfigSourceType sourceType) {
this.m_sourceType = sourceType;
if (newProperties.equals(m_fileProperties)) {
return;
}
this.m_fileProperties = newProperties;
persistLocalCacheFile(m_baseDir, m_namespace);
}
private Properties loadFromLocalCacheFile(File baseDir, String namespace) throws IOException {
Preconditions.checkNotNull(baseDir, "Basedir cannot be null");
File file = assembleLocalCacheFile(baseDir, namespace);
Properties properties = null;
if (file.isFile() && file.canRead()) {
InputStream in = null;
try {
in = new FileInputStream(file);
properties = propertiesFactory.getPropertiesInstance();
properties.load(in);
logger.debug("Loading local config file {} successfully!", file.getAbsolutePath());
} catch (IOException ex) {
Tracer.logError(ex);
throw new ApolloConfigException(String
.format("Loading config from local cache file %s failed", file.getAbsolutePath()), ex);
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException ex) {
// ignore
}
}
} else {
throw new ApolloConfigException(
String.format("Cannot read from local cache file %s", file.getAbsolutePath()));
}
return properties;
}
void persistLocalCacheFile(File baseDir, String namespace) {
if (baseDir == null) {
return;
}
File file = assembleLocalCacheFile(baseDir, namespace);
OutputStream out = null;
Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "persistLocalConfigFile");
transaction.addData("LocalConfigFile", file.getAbsolutePath());
try {
out = new FileOutputStream(file);
m_fileProperties.store(out, "Persisted by DefaultConfig");
transaction.setStatus(Transaction.SUCCESS);
} catch (IOException ex) {
ApolloConfigException exception =
new ApolloConfigException(
String.format("Persist local cache file %s failed", file.getAbsolutePath()), ex);
Tracer.logError(exception);
transaction.setStatus(exception);
logger.warn("Persist local cache file {} failed, reason: {}.", file.getAbsolutePath(),
ExceptionUtil.getDetailMessage(ex));
} finally {
if (out != null) {
try {
out.close();
} catch (IOException ex) {
//ignore
}
}
transaction.complete();
}
}
private void checkLocalConfigCacheDir(File baseDir) {
if (baseDir.exists()) {
return;
}
Transaction transaction = Tracer.newTransaction("Apollo.ConfigService", "createLocalConfigDir");
transaction.addData("BaseDir", baseDir.getAbsolutePath());
try {
Files.createDirectory(baseDir.toPath());
transaction.setStatus(Transaction.SUCCESS);
} catch (IOException ex) {
ApolloConfigException exception =
new ApolloConfigException(
String.format("Create local config directory %s failed", baseDir.getAbsolutePath()),
ex);
Tracer.logError(exception);
transaction.setStatus(exception);
logger.warn(
"Unable to create local config cache directory {}, reason: {}. Will not able to cache config file.",
baseDir.getAbsolutePath(), ExceptionUtil.getDetailMessage(ex));
} finally {
transaction.complete();
}
}
File assembleLocalCacheFile(File baseDir, String namespace) {
String fileName =
String.format("%s.properties", Joiner.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR)
.join(m_configUtil.getAppId(), m_configUtil.getCluster(), namespace));
return new File(baseDir, fileName);
}
}
| 1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/ConfigController.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.configservice.controller;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.common.entity.AppNamespace;
import com.ctrip.framework.apollo.configservice.service.AppNamespaceServiceWithCache;
import com.ctrip.framework.apollo.configservice.service.config.ConfigService;
import com.ctrip.framework.apollo.configservice.util.InstanceConfigAuditUtil;
import com.ctrip.framework.apollo.configservice.util.NamespaceUtil;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.dto.ApolloConfig;
import com.ctrip.framework.apollo.core.dto.ApolloNotificationMessages;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RestController
@RequestMapping("/configs")
public class ConfigController {
private static final Splitter X_FORWARDED_FOR_SPLITTER = Splitter.on(",").omitEmptyStrings()
.trimResults();
private final ConfigService configService;
private final AppNamespaceServiceWithCache appNamespaceService;
private final NamespaceUtil namespaceUtil;
private final InstanceConfigAuditUtil instanceConfigAuditUtil;
private final Gson gson;
private static final Type configurationTypeReference = new TypeToken<Map<String, String>>() {
}.getType();
public ConfigController(
final ConfigService configService,
final AppNamespaceServiceWithCache appNamespaceService,
final NamespaceUtil namespaceUtil,
final InstanceConfigAuditUtil instanceConfigAuditUtil,
final Gson gson) {
this.configService = configService;
this.appNamespaceService = appNamespaceService;
this.namespaceUtil = namespaceUtil;
this.instanceConfigAuditUtil = instanceConfigAuditUtil;
this.gson = gson;
}
@GetMapping(value = "/{appId}/{clusterName}/{namespace:.+}")
public ApolloConfig queryConfig(@PathVariable String appId, @PathVariable String clusterName,
@PathVariable String namespace,
@RequestParam(value = "dataCenter", required = false) String dataCenter,
@RequestParam(value = "releaseKey", defaultValue = "-1") String clientSideReleaseKey,
@RequestParam(value = "ip", required = false) String clientIp,
@RequestParam(value = "messages", required = false) String messagesAsString,
HttpServletRequest request, HttpServletResponse response) throws IOException {
String originalNamespace = namespace;
//strip out .properties suffix
namespace = namespaceUtil.filterNamespaceName(namespace);
//fix the character case issue, such as FX.apollo <-> fx.apollo
namespace = namespaceUtil.normalizeNamespace(appId, namespace);
if (Strings.isNullOrEmpty(clientIp)) {
clientIp = tryToGetClientIp(request);
}
ApolloNotificationMessages clientMessages = transformMessages(messagesAsString);
List<Release> releases = Lists.newLinkedList();
String appClusterNameLoaded = clusterName;
if (!ConfigConsts.NO_APPID_PLACEHOLDER.equalsIgnoreCase(appId)) {
Release currentAppRelease = configService.loadConfig(appId, clientIp, appId, clusterName, namespace,
dataCenter, clientMessages);
if (currentAppRelease != null) {
releases.add(currentAppRelease);
//we have cluster search process, so the cluster name might be overridden
appClusterNameLoaded = currentAppRelease.getClusterName();
}
}
//if namespace does not belong to this appId, should check if there is a public configuration
if (!namespaceBelongsToAppId(appId, namespace)) {
Release publicRelease = this.findPublicConfig(appId, clientIp, clusterName, namespace,
dataCenter, clientMessages);
if (!Objects.isNull(publicRelease)) {
releases.add(publicRelease);
}
}
if (releases.isEmpty()) {
response.sendError(HttpServletResponse.SC_NOT_FOUND,
String.format(
"Could not load configurations with appId: %s, clusterName: %s, namespace: %s",
appId, clusterName, originalNamespace));
Tracer.logEvent("Apollo.Config.NotFound",
assembleKey(appId, clusterName, originalNamespace, dataCenter));
return null;
}
auditReleases(appId, clusterName, dataCenter, clientIp, releases);
String mergedReleaseKey = releases.stream().map(Release::getReleaseKey)
.collect(Collectors.joining(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR));
if (mergedReleaseKey.equals(clientSideReleaseKey)) {
// Client side configuration is the same with server side, return 304
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
Tracer.logEvent("Apollo.Config.NotModified",
assembleKey(appId, appClusterNameLoaded, originalNamespace, dataCenter));
return null;
}
ApolloConfig apolloConfig = new ApolloConfig(appId, appClusterNameLoaded, originalNamespace,
mergedReleaseKey);
apolloConfig.setConfigurations(mergeReleaseConfigurations(releases));
Tracer.logEvent("Apollo.Config.Found", assembleKey(appId, appClusterNameLoaded,
originalNamespace, dataCenter));
return apolloConfig;
}
private boolean namespaceBelongsToAppId(String appId, String namespaceName) {
//Every app has an 'application' namespace
if (Objects.equals(ConfigConsts.NAMESPACE_APPLICATION, namespaceName)) {
return true;
}
//if no appId is present, then no other namespace belongs to it
if (ConfigConsts.NO_APPID_PLACEHOLDER.equalsIgnoreCase(appId)) {
return false;
}
AppNamespace appNamespace = appNamespaceService.findByAppIdAndNamespace(appId, namespaceName);
return appNamespace != null;
}
/**
* @param clientAppId the application which uses public config
* @param namespace the namespace
* @param dataCenter the datacenter
*/
private Release findPublicConfig(String clientAppId, String clientIp, String clusterName,
String namespace, String dataCenter, ApolloNotificationMessages clientMessages) {
AppNamespace appNamespace = appNamespaceService.findPublicNamespaceByName(namespace);
//check whether the namespace's appId equals to current one
if (Objects.isNull(appNamespace) || Objects.equals(clientAppId, appNamespace.getAppId())) {
return null;
}
String publicConfigAppId = appNamespace.getAppId();
return configService.loadConfig(clientAppId, clientIp, publicConfigAppId, clusterName, namespace, dataCenter,
clientMessages);
}
/**
* Merge configurations of releases.
* Release in lower index override those in higher index
*/
Map<String, String> mergeReleaseConfigurations(List<Release> releases) {
Map<String, String> result = Maps.newLinkedHashMap();
for (Release release : Lists.reverse(releases)) {
result.putAll(gson.fromJson(release.getConfigurations(), configurationTypeReference));
}
return result;
}
private String assembleKey(String appId, String cluster, String namespace, String dataCenter) {
List<String> keyParts = Lists.newArrayList(appId, cluster, namespace);
if (!Strings.isNullOrEmpty(dataCenter)) {
keyParts.add(dataCenter);
}
return String.join(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR, keyParts);
}
private void auditReleases(String appId, String cluster, String dataCenter, String clientIp,
List<Release> releases) {
if (Strings.isNullOrEmpty(clientIp)) {
//no need to audit instance config when there is no ip
return;
}
for (Release release : releases) {
instanceConfigAuditUtil.audit(appId, cluster, dataCenter, clientIp, release.getAppId(),
release.getClusterName(),
release.getNamespaceName(), release.getReleaseKey());
}
}
private String tryToGetClientIp(HttpServletRequest request) {
String forwardedFor = request.getHeader("X-FORWARDED-FOR");
if (!Strings.isNullOrEmpty(forwardedFor)) {
return X_FORWARDED_FOR_SPLITTER.splitToList(forwardedFor).get(0);
}
return request.getRemoteAddr();
}
ApolloNotificationMessages transformMessages(String messagesAsString) {
ApolloNotificationMessages notificationMessages = null;
if (!Strings.isNullOrEmpty(messagesAsString)) {
try {
notificationMessages = gson.fromJson(messagesAsString, ApolloNotificationMessages.class);
} catch (Throwable ex) {
Tracer.logError(ex);
}
}
return notificationMessages;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.configservice.controller;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.common.entity.AppNamespace;
import com.ctrip.framework.apollo.configservice.service.AppNamespaceServiceWithCache;
import com.ctrip.framework.apollo.configservice.service.config.ConfigService;
import com.ctrip.framework.apollo.configservice.util.InstanceConfigAuditUtil;
import com.ctrip.framework.apollo.configservice.util.NamespaceUtil;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.dto.ApolloConfig;
import com.ctrip.framework.apollo.core.dto.ApolloNotificationMessages;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RestController
@RequestMapping("/configs")
public class ConfigController {
private static final Splitter X_FORWARDED_FOR_SPLITTER = Splitter.on(",").omitEmptyStrings()
.trimResults();
private final ConfigService configService;
private final AppNamespaceServiceWithCache appNamespaceService;
private final NamespaceUtil namespaceUtil;
private final InstanceConfigAuditUtil instanceConfigAuditUtil;
private final Gson gson;
private static final Type configurationTypeReference = new TypeToken<Map<String, String>>() {
}.getType();
public ConfigController(
final ConfigService configService,
final AppNamespaceServiceWithCache appNamespaceService,
final NamespaceUtil namespaceUtil,
final InstanceConfigAuditUtil instanceConfigAuditUtil,
final Gson gson) {
this.configService = configService;
this.appNamespaceService = appNamespaceService;
this.namespaceUtil = namespaceUtil;
this.instanceConfigAuditUtil = instanceConfigAuditUtil;
this.gson = gson;
}
@GetMapping(value = "/{appId}/{clusterName}/{namespace:.+}")
public ApolloConfig queryConfig(@PathVariable String appId, @PathVariable String clusterName,
@PathVariable String namespace,
@RequestParam(value = "dataCenter", required = false) String dataCenter,
@RequestParam(value = "releaseKey", defaultValue = "-1") String clientSideReleaseKey,
@RequestParam(value = "ip", required = false) String clientIp,
@RequestParam(value = "messages", required = false) String messagesAsString,
HttpServletRequest request, HttpServletResponse response) throws IOException {
String originalNamespace = namespace;
//strip out .properties suffix
namespace = namespaceUtil.filterNamespaceName(namespace);
//fix the character case issue, such as FX.apollo <-> fx.apollo
namespace = namespaceUtil.normalizeNamespace(appId, namespace);
if (Strings.isNullOrEmpty(clientIp)) {
clientIp = tryToGetClientIp(request);
}
ApolloNotificationMessages clientMessages = transformMessages(messagesAsString);
List<Release> releases = Lists.newLinkedList();
String appClusterNameLoaded = clusterName;
if (!ConfigConsts.NO_APPID_PLACEHOLDER.equalsIgnoreCase(appId)) {
Release currentAppRelease = configService.loadConfig(appId, clientIp, appId, clusterName, namespace,
dataCenter, clientMessages);
if (currentAppRelease != null) {
releases.add(currentAppRelease);
//we have cluster search process, so the cluster name might be overridden
appClusterNameLoaded = currentAppRelease.getClusterName();
}
}
//if namespace does not belong to this appId, should check if there is a public configuration
if (!namespaceBelongsToAppId(appId, namespace)) {
Release publicRelease = this.findPublicConfig(appId, clientIp, clusterName, namespace,
dataCenter, clientMessages);
if (Objects.nonNull(publicRelease)) {
releases.add(publicRelease);
}
}
if (releases.isEmpty()) {
response.sendError(HttpServletResponse.SC_NOT_FOUND,
String.format(
"Could not load configurations with appId: %s, clusterName: %s, namespace: %s",
appId, clusterName, originalNamespace));
Tracer.logEvent("Apollo.Config.NotFound",
assembleKey(appId, clusterName, originalNamespace, dataCenter));
return null;
}
auditReleases(appId, clusterName, dataCenter, clientIp, releases);
String mergedReleaseKey = releases.stream().map(Release::getReleaseKey)
.collect(Collectors.joining(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR));
if (mergedReleaseKey.equals(clientSideReleaseKey)) {
// Client side configuration is the same with server side, return 304
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
Tracer.logEvent("Apollo.Config.NotModified",
assembleKey(appId, appClusterNameLoaded, originalNamespace, dataCenter));
return null;
}
ApolloConfig apolloConfig = new ApolloConfig(appId, appClusterNameLoaded, originalNamespace,
mergedReleaseKey);
apolloConfig.setConfigurations(mergeReleaseConfigurations(releases));
Tracer.logEvent("Apollo.Config.Found", assembleKey(appId, appClusterNameLoaded,
originalNamespace, dataCenter));
return apolloConfig;
}
private boolean namespaceBelongsToAppId(String appId, String namespaceName) {
//Every app has an 'application' namespace
if (Objects.equals(ConfigConsts.NAMESPACE_APPLICATION, namespaceName)) {
return true;
}
//if no appId is present, then no other namespace belongs to it
if (ConfigConsts.NO_APPID_PLACEHOLDER.equalsIgnoreCase(appId)) {
return false;
}
AppNamespace appNamespace = appNamespaceService.findByAppIdAndNamespace(appId, namespaceName);
return appNamespace != null;
}
/**
* @param clientAppId the application which uses public config
* @param namespace the namespace
* @param dataCenter the datacenter
*/
private Release findPublicConfig(String clientAppId, String clientIp, String clusterName,
String namespace, String dataCenter, ApolloNotificationMessages clientMessages) {
AppNamespace appNamespace = appNamespaceService.findPublicNamespaceByName(namespace);
//check whether the namespace's appId equals to current one
if (Objects.isNull(appNamespace) || Objects.equals(clientAppId, appNamespace.getAppId())) {
return null;
}
String publicConfigAppId = appNamespace.getAppId();
return configService.loadConfig(clientAppId, clientIp, publicConfigAppId, clusterName, namespace, dataCenter,
clientMessages);
}
/**
* Merge configurations of releases.
* Release in lower index override those in higher index
*/
Map<String, String> mergeReleaseConfigurations(List<Release> releases) {
Map<String, String> result = Maps.newLinkedHashMap();
for (Release release : Lists.reverse(releases)) {
result.putAll(gson.fromJson(release.getConfigurations(), configurationTypeReference));
}
return result;
}
private String assembleKey(String appId, String cluster, String namespace, String dataCenter) {
List<String> keyParts = Lists.newArrayList(appId, cluster, namespace);
if (!Strings.isNullOrEmpty(dataCenter)) {
keyParts.add(dataCenter);
}
return String.join(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR, keyParts);
}
private void auditReleases(String appId, String cluster, String dataCenter, String clientIp,
List<Release> releases) {
if (Strings.isNullOrEmpty(clientIp)) {
//no need to audit instance config when there is no ip
return;
}
for (Release release : releases) {
instanceConfigAuditUtil.audit(appId, cluster, dataCenter, clientIp, release.getAppId(),
release.getClusterName(),
release.getNamespaceName(), release.getReleaseKey());
}
}
private String tryToGetClientIp(HttpServletRequest request) {
String forwardedFor = request.getHeader("X-FORWARDED-FOR");
if (!Strings.isNullOrEmpty(forwardedFor)) {
return X_FORWARDED_FOR_SPLITTER.splitToList(forwardedFor).get(0);
}
return request.getRemoteAddr();
}
ApolloNotificationMessages transformMessages(String messagesAsString) {
ApolloNotificationMessages notificationMessages = null;
if (!Strings.isNullOrEmpty(messagesAsString)) {
try {
notificationMessages = gson.fromJson(messagesAsString, ApolloNotificationMessages.class);
} catch (Throwable ex) {
Tracer.logError(ex);
}
}
return notificationMessages;
}
}
| 1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/config/AbstractConfigService.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.configservice.service.config;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.biz.grayReleaseRule.GrayReleaseRulesHolder;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.dto.ApolloNotificationMessages;
import com.google.common.base.Strings;
import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public abstract class AbstractConfigService implements ConfigService {
@Autowired
private GrayReleaseRulesHolder grayReleaseRulesHolder;
@Override
public Release loadConfig(String clientAppId, String clientIp, String configAppId, String configClusterName,
String configNamespace, String dataCenter, ApolloNotificationMessages clientMessages) {
// load from specified cluster fist
if (!Objects.equals(ConfigConsts.CLUSTER_NAME_DEFAULT, configClusterName)) {
Release clusterRelease = findRelease(clientAppId, clientIp, configAppId, configClusterName, configNamespace,
clientMessages);
if (!Objects.isNull(clusterRelease)) {
return clusterRelease;
}
}
// try to load via data center
if (!Strings.isNullOrEmpty(dataCenter) && !Objects.equals(dataCenter, configClusterName)) {
Release dataCenterRelease = findRelease(clientAppId, clientIp, configAppId, dataCenter, configNamespace,
clientMessages);
if (!Objects.isNull(dataCenterRelease)) {
return dataCenterRelease;
}
}
// fallback to default release
return findRelease(clientAppId, clientIp, configAppId, ConfigConsts.CLUSTER_NAME_DEFAULT, configNamespace,
clientMessages);
}
/**
* Find release
*
* @param clientAppId the client's app id
* @param clientIp the client ip
* @param configAppId the requested config's app id
* @param configClusterName the requested config's cluster name
* @param configNamespace the requested config's namespace name
* @param clientMessages the messages received in client side
* @return the release
*/
private Release findRelease(String clientAppId, String clientIp, String configAppId, String configClusterName,
String configNamespace, ApolloNotificationMessages clientMessages) {
Long grayReleaseId = grayReleaseRulesHolder.findReleaseIdFromGrayReleaseRule(clientAppId, clientIp, configAppId,
configClusterName, configNamespace);
Release release = null;
if (grayReleaseId != null) {
release = findActiveOne(grayReleaseId, clientMessages);
}
if (release == null) {
release = findLatestActiveRelease(configAppId, configClusterName, configNamespace, clientMessages);
}
return release;
}
/**
* Find active release by id
*/
protected abstract Release findActiveOne(long id, ApolloNotificationMessages clientMessages);
/**
* Find active release by app id, cluster name and namespace name
*/
protected abstract Release findLatestActiveRelease(String configAppId, String configClusterName,
String configNamespaceName, ApolloNotificationMessages clientMessages);
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.configservice.service.config;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.biz.grayReleaseRule.GrayReleaseRulesHolder;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.dto.ApolloNotificationMessages;
import com.google.common.base.Strings;
import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public abstract class AbstractConfigService implements ConfigService {
@Autowired
private GrayReleaseRulesHolder grayReleaseRulesHolder;
@Override
public Release loadConfig(String clientAppId, String clientIp, String configAppId, String configClusterName,
String configNamespace, String dataCenter, ApolloNotificationMessages clientMessages) {
// load from specified cluster fist
if (!Objects.equals(ConfigConsts.CLUSTER_NAME_DEFAULT, configClusterName)) {
Release clusterRelease = findRelease(clientAppId, clientIp, configAppId, configClusterName, configNamespace,
clientMessages);
if (Objects.nonNull(clusterRelease)) {
return clusterRelease;
}
}
// try to load via data center
if (!Strings.isNullOrEmpty(dataCenter) && !Objects.equals(dataCenter, configClusterName)) {
Release dataCenterRelease = findRelease(clientAppId, clientIp, configAppId, dataCenter, configNamespace,
clientMessages);
if (Objects.nonNull(dataCenterRelease)) {
return dataCenterRelease;
}
}
// fallback to default release
return findRelease(clientAppId, clientIp, configAppId, ConfigConsts.CLUSTER_NAME_DEFAULT, configNamespace,
clientMessages);
}
/**
* Find release
*
* @param clientAppId the client's app id
* @param clientIp the client ip
* @param configAppId the requested config's app id
* @param configClusterName the requested config's cluster name
* @param configNamespace the requested config's namespace name
* @param clientMessages the messages received in client side
* @return the release
*/
private Release findRelease(String clientAppId, String clientIp, String configAppId, String configClusterName,
String configNamespace, ApolloNotificationMessages clientMessages) {
Long grayReleaseId = grayReleaseRulesHolder.findReleaseIdFromGrayReleaseRule(clientAppId, clientIp, configAppId,
configClusterName, configNamespace);
Release release = null;
if (grayReleaseId != null) {
release = findActiveOne(grayReleaseId, clientMessages);
}
if (release == null) {
release = findLatestActiveRelease(configAppId, configClusterName, configNamespace, clientMessages);
}
return release;
}
/**
* Find active release by id
*/
protected abstract Release findActiveOne(long id, ApolloNotificationMessages clientMessages);
/**
* Find active release by app id, cluster name and namespace name
*/
protected abstract Release findLatestActiveRelease(String configAppId, String configClusterName,
String configNamespaceName, ApolloNotificationMessages clientMessages);
}
| 1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-configservice/src/test/java/com/ctrip/framework/apollo/configservice/service/config/ConfigServiceWithCacheTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.configservice.service.config;
import com.ctrip.framework.apollo.core.dto.ApolloNotificationMessages;
import com.google.common.collect.Lists;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.biz.entity.ReleaseMessage;
import com.ctrip.framework.apollo.biz.message.Topics;
import com.ctrip.framework.apollo.biz.service.ReleaseMessageService;
import com.ctrip.framework.apollo.biz.service.ReleaseService;
import com.ctrip.framework.apollo.biz.utils.ReleaseMessageKeyGenerator;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.test.util.ReflectionTestUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RunWith(MockitoJUnitRunner.class)
public class ConfigServiceWithCacheTest {
private ConfigServiceWithCache configServiceWithCache;
@Mock
private ReleaseService releaseService;
@Mock
private ReleaseMessageService releaseMessageService;
@Mock
private Release someRelease;
@Mock
private ReleaseMessage someReleaseMessage;
private String someAppId;
private String someClusterName;
private String someNamespaceName;
private String someKey;
private long someNotificationId;
private ApolloNotificationMessages someNotificationMessages;
@Before
public void setUp() throws Exception {
configServiceWithCache = new ConfigServiceWithCache();
ReflectionTestUtils.setField(configServiceWithCache, "releaseService", releaseService);
ReflectionTestUtils.setField(configServiceWithCache, "releaseMessageService", releaseMessageService);
configServiceWithCache.initialize();
someAppId = "someAppId";
someClusterName = "someClusterName";
someNamespaceName = "someNamespaceName";
someNotificationId = 1;
someKey = ReleaseMessageKeyGenerator.generate(someAppId, someClusterName, someNamespaceName);
someNotificationMessages = new ApolloNotificationMessages();
}
@Test
public void testFindActiveOne() throws Exception {
long someId = 1;
when(releaseService.findActiveOne(someId)).thenReturn(someRelease);
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
}
@Test
public void testFindActiveOneWithSameIdMultipleTimes() throws Exception {
long someId = 1;
when(releaseService.findActiveOne(someId)).thenReturn(someRelease);
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
}
@Test
public void testFindActiveOneWithMultipleIdMultipleTimes() throws Exception {
long someId = 1;
long anotherId = 2;
Release anotherRelease = mock(Release.class);
when(releaseService.findActiveOne(someId)).thenReturn(someRelease);
when(releaseService.findActiveOne(anotherId)).thenReturn(anotherRelease);
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(anotherRelease, configServiceWithCache.findActiveOne(anotherId, someNotificationMessages));
assertEquals(anotherRelease, configServiceWithCache.findActiveOne(anotherId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
verify(releaseService, times(1)).findActiveOne(anotherId);
}
@Test
public void testFindActiveOneWithReleaseNotFoundMultipleTimes() throws Exception {
long someId = 1;
when(releaseService.findActiveOne(someId)).thenReturn(null);
assertNull(configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertNull(configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertNull(configServiceWithCache.findActiveOne(someId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
}
@Test
public void testFindLatestActiveRelease() throws Exception {
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
Release anotherRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
int retryTimes = 100;
for (int i = 0; i < retryTimes; i++) {
configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
}
assertEquals(someRelease, release);
assertEquals(someRelease, anotherRelease);
verify(releaseMessageService, times(1)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(1)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithReleaseNotFound() throws Exception {
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn(null);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn(null);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
Release anotherRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
int retryTimes = 100;
for (int i = 0; i < retryTimes; i++) {
configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
}
assertNull(release);
assertNull(anotherRelease);
verify(releaseMessageService, times(1)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(1)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithDirtyRelease() throws Exception {
long someNewNotificationId = someNotificationId + 1;
ReleaseMessage anotherReleaseMessage = mock(ReleaseMessage.class);
Release anotherRelease = mock(Release.class);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(anotherReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(anotherRelease);
when(anotherReleaseMessage.getId()).thenReturn(someNewNotificationId);
Release stillOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
someNotificationMessages.put(someKey, someNewNotificationId);
Release shouldBeNewRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
assertEquals(someRelease, release);
assertEquals(someRelease, stillOldRelease);
assertEquals(anotherRelease, shouldBeNewRelease);
verify(releaseMessageService, times(2)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(2)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithReleaseMessageNotification() throws Exception {
long someNewNotificationId = someNotificationId + 1;
ReleaseMessage anotherReleaseMessage = mock(ReleaseMessage.class);
Release anotherRelease = mock(Release.class);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(anotherReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(anotherRelease);
when(anotherReleaseMessage.getMessage()).thenReturn(someKey);
when(anotherReleaseMessage.getId()).thenReturn(someNewNotificationId);
Release stillOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
configServiceWithCache.handleMessage(anotherReleaseMessage, Topics.APOLLO_RELEASE_TOPIC);
Release shouldBeNewRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
assertEquals(someRelease, release);
assertEquals(someRelease, stillOldRelease);
assertEquals(anotherRelease, shouldBeNewRelease);
verify(releaseMessageService, times(2)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(2)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithIrrelevantMessages() throws Exception {
long someNewNotificationId = someNotificationId + 1;
String someIrrelevantKey = "someIrrelevantKey";
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
Release stillOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
someNotificationMessages.put(someIrrelevantKey, someNewNotificationId);
Release shouldStillBeOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
assertEquals(someRelease, release);
assertEquals(someRelease, stillOldRelease);
assertEquals(someRelease, shouldStillBeOldRelease);
verify(releaseMessageService, times(1)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(1)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.configservice.service.config;
import com.ctrip.framework.apollo.core.dto.ApolloNotificationMessages;
import com.google.common.collect.Lists;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.biz.entity.ReleaseMessage;
import com.ctrip.framework.apollo.biz.message.Topics;
import com.ctrip.framework.apollo.biz.service.ReleaseMessageService;
import com.ctrip.framework.apollo.biz.service.ReleaseService;
import com.ctrip.framework.apollo.biz.utils.ReleaseMessageKeyGenerator;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.test.util.ReflectionTestUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RunWith(MockitoJUnitRunner.class)
public class ConfigServiceWithCacheTest {
private ConfigServiceWithCache configServiceWithCache;
@Mock
private ReleaseService releaseService;
@Mock
private ReleaseMessageService releaseMessageService;
@Mock
private Release someRelease;
@Mock
private ReleaseMessage someReleaseMessage;
private String someAppId;
private String someClusterName;
private String someNamespaceName;
private String someKey;
private long someNotificationId;
private ApolloNotificationMessages someNotificationMessages;
@Before
public void setUp() throws Exception {
configServiceWithCache = new ConfigServiceWithCache();
ReflectionTestUtils.setField(configServiceWithCache, "releaseService", releaseService);
ReflectionTestUtils.setField(configServiceWithCache, "releaseMessageService", releaseMessageService);
configServiceWithCache.initialize();
someAppId = "someAppId";
someClusterName = "someClusterName";
someNamespaceName = "someNamespaceName";
someNotificationId = 1;
someKey = ReleaseMessageKeyGenerator.generate(someAppId, someClusterName, someNamespaceName);
someNotificationMessages = new ApolloNotificationMessages();
}
@Test
public void testFindActiveOne() throws Exception {
long someId = 1;
when(releaseService.findActiveOne(someId)).thenReturn(someRelease);
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
}
@Test
public void testFindActiveOneWithSameIdMultipleTimes() throws Exception {
long someId = 1;
when(releaseService.findActiveOne(someId)).thenReturn(someRelease);
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
}
@Test
public void testFindActiveOneWithMultipleIdMultipleTimes() throws Exception {
long someId = 1;
long anotherId = 2;
Release anotherRelease = mock(Release.class);
when(releaseService.findActiveOne(someId)).thenReturn(someRelease);
when(releaseService.findActiveOne(anotherId)).thenReturn(anotherRelease);
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(someRelease, configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertEquals(anotherRelease, configServiceWithCache.findActiveOne(anotherId, someNotificationMessages));
assertEquals(anotherRelease, configServiceWithCache.findActiveOne(anotherId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
verify(releaseService, times(1)).findActiveOne(anotherId);
}
@Test
public void testFindActiveOneWithReleaseNotFoundMultipleTimes() throws Exception {
long someId = 1;
when(releaseService.findActiveOne(someId)).thenReturn(null);
assertNull(configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertNull(configServiceWithCache.findActiveOne(someId, someNotificationMessages));
assertNull(configServiceWithCache.findActiveOne(someId, someNotificationMessages));
verify(releaseService, times(1)).findActiveOne(someId);
}
@Test
public void testFindLatestActiveRelease() throws Exception {
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
Release anotherRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
int retryTimes = 100;
for (int i = 0; i < retryTimes; i++) {
configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
}
assertEquals(someRelease, release);
assertEquals(someRelease, anotherRelease);
verify(releaseMessageService, times(1)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(1)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithReleaseNotFound() throws Exception {
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn(null);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn(null);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
Release anotherRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
int retryTimes = 100;
for (int i = 0; i < retryTimes; i++) {
configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
}
assertNull(release);
assertNull(anotherRelease);
verify(releaseMessageService, times(1)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(1)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithDirtyRelease() throws Exception {
long someNewNotificationId = someNotificationId + 1;
ReleaseMessage anotherReleaseMessage = mock(ReleaseMessage.class);
Release anotherRelease = mock(Release.class);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(anotherReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(anotherRelease);
when(anotherReleaseMessage.getId()).thenReturn(someNewNotificationId);
Release stillOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
someNotificationMessages.put(someKey, someNewNotificationId);
Release shouldBeNewRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
assertEquals(someRelease, release);
assertEquals(someRelease, stillOldRelease);
assertEquals(anotherRelease, shouldBeNewRelease);
verify(releaseMessageService, times(2)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(2)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithReleaseMessageNotification() throws Exception {
long someNewNotificationId = someNotificationId + 1;
ReleaseMessage anotherReleaseMessage = mock(ReleaseMessage.class);
Release anotherRelease = mock(Release.class);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(anotherReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(anotherRelease);
when(anotherReleaseMessage.getMessage()).thenReturn(someKey);
when(anotherReleaseMessage.getId()).thenReturn(someNewNotificationId);
Release stillOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
configServiceWithCache.handleMessage(anotherReleaseMessage, Topics.APOLLO_RELEASE_TOPIC);
Release shouldBeNewRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
assertEquals(someRelease, release);
assertEquals(someRelease, stillOldRelease);
assertEquals(anotherRelease, shouldBeNewRelease);
verify(releaseMessageService, times(2)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(2)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
@Test
public void testFindLatestActiveReleaseWithIrrelevantMessages() throws Exception {
long someNewNotificationId = someNotificationId + 1;
String someIrrelevantKey = "someIrrelevantKey";
when(releaseMessageService.findLatestReleaseMessageForMessages(Lists.newArrayList(someKey))).thenReturn
(someReleaseMessage);
when(releaseService.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName)).thenReturn
(someRelease);
when(someReleaseMessage.getId()).thenReturn(someNotificationId);
Release release = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName, someNamespaceName,
someNotificationMessages);
Release stillOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
someNotificationMessages.put(someIrrelevantKey, someNewNotificationId);
Release shouldStillBeOldRelease = configServiceWithCache.findLatestActiveRelease(someAppId, someClusterName,
someNamespaceName, someNotificationMessages);
assertEquals(someRelease, release);
assertEquals(someRelease, stillOldRelease);
assertEquals(someRelease, shouldStillBeOldRelease);
verify(releaseMessageService, times(1)).findLatestReleaseMessageForMessages(Lists.newArrayList(someKey));
verify(releaseService, times(1)).findLatestActiveRelease(someAppId, someClusterName, someNamespaceName);
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/RoleUtils.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.util;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.portal.constant.RoleType;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import java.util.Iterator;
public class RoleUtils {
private static final Joiner STRING_JOINER = Joiner.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR).skipNulls();
private static final Splitter STRING_SPLITTER = Splitter.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR)
.omitEmptyStrings().trimResults();
public static String buildAppMasterRoleName(String appId) {
return STRING_JOINER.join(RoleType.MASTER, appId);
}
public static String extractAppIdFromMasterRoleName(String masterRoleName) {
Iterator<String> parts = STRING_SPLITTER.split(masterRoleName).iterator();
// skip role type
if (parts.hasNext() && parts.next().equals(RoleType.MASTER) && parts.hasNext()) {
return parts.next();
}
return null;
}
public static String extractAppIdFromRoleName(String roleName) {
Iterator<String> parts = STRING_SPLITTER.split(roleName).iterator();
if (parts.hasNext()) {
String roleType = parts.next();
if (RoleType.isValidRoleType(roleType) && parts.hasNext()) {
return parts.next();
}
}
return null;
}
public static String buildAppRoleName(String appId, String roleType) {
return STRING_JOINER.join(roleType, appId);
}
public static String buildModifyNamespaceRoleName(String appId, String namespaceName) {
return buildModifyNamespaceRoleName(appId, namespaceName, null);
}
public static String buildModifyNamespaceRoleName(String appId, String namespaceName, String env) {
return STRING_JOINER.join(RoleType.MODIFY_NAMESPACE, appId, namespaceName, env);
}
public static String buildModifyDefaultNamespaceRoleName(String appId) {
return STRING_JOINER.join(RoleType.MODIFY_NAMESPACE, appId, ConfigConsts.NAMESPACE_APPLICATION);
}
public static String buildReleaseNamespaceRoleName(String appId, String namespaceName) {
return buildReleaseNamespaceRoleName(appId, namespaceName, null);
}
public static String buildReleaseNamespaceRoleName(String appId, String namespaceName, String env) {
return STRING_JOINER.join(RoleType.RELEASE_NAMESPACE, appId, namespaceName, env);
}
public static String buildNamespaceRoleName(String appId, String namespaceName, String roleType) {
return buildNamespaceRoleName(appId, namespaceName, roleType, null);
}
public static String buildNamespaceRoleName(String appId, String namespaceName, String roleType, String env) {
return STRING_JOINER.join(roleType, appId, namespaceName, env);
}
public static String buildReleaseDefaultNamespaceRoleName(String appId) {
return STRING_JOINER.join(RoleType.RELEASE_NAMESPACE, appId, ConfigConsts.NAMESPACE_APPLICATION);
}
public static String buildNamespaceTargetId(String appId, String namespaceName) {
return buildNamespaceTargetId(appId, namespaceName, null);
}
public static String buildNamespaceTargetId(String appId, String namespaceName, String env) {
return STRING_JOINER.join(appId, namespaceName, env);
}
public static String buildDefaultNamespaceTargetId(String appId) {
return STRING_JOINER.join(appId, ConfigConsts.NAMESPACE_APPLICATION);
}
public static String buildCreateApplicationRoleName(String permissionType, String permissionTargetId) {
return STRING_JOINER.join(permissionType, permissionTargetId);
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.util;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.portal.constant.RoleType;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import java.util.Iterator;
public class RoleUtils {
private static final Joiner STRING_JOINER = Joiner.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR).skipNulls();
private static final Splitter STRING_SPLITTER = Splitter.on(ConfigConsts.CLUSTER_NAMESPACE_SEPARATOR)
.omitEmptyStrings().trimResults();
public static String buildAppMasterRoleName(String appId) {
return STRING_JOINER.join(RoleType.MASTER, appId);
}
public static String extractAppIdFromMasterRoleName(String masterRoleName) {
Iterator<String> parts = STRING_SPLITTER.split(masterRoleName).iterator();
// skip role type
if (parts.hasNext() && parts.next().equals(RoleType.MASTER) && parts.hasNext()) {
return parts.next();
}
return null;
}
public static String extractAppIdFromRoleName(String roleName) {
Iterator<String> parts = STRING_SPLITTER.split(roleName).iterator();
if (parts.hasNext()) {
String roleType = parts.next();
if (RoleType.isValidRoleType(roleType) && parts.hasNext()) {
return parts.next();
}
}
return null;
}
public static String buildAppRoleName(String appId, String roleType) {
return STRING_JOINER.join(roleType, appId);
}
public static String buildModifyNamespaceRoleName(String appId, String namespaceName) {
return buildModifyNamespaceRoleName(appId, namespaceName, null);
}
public static String buildModifyNamespaceRoleName(String appId, String namespaceName, String env) {
return STRING_JOINER.join(RoleType.MODIFY_NAMESPACE, appId, namespaceName, env);
}
public static String buildModifyDefaultNamespaceRoleName(String appId) {
return STRING_JOINER.join(RoleType.MODIFY_NAMESPACE, appId, ConfigConsts.NAMESPACE_APPLICATION);
}
public static String buildReleaseNamespaceRoleName(String appId, String namespaceName) {
return buildReleaseNamespaceRoleName(appId, namespaceName, null);
}
public static String buildReleaseNamespaceRoleName(String appId, String namespaceName, String env) {
return STRING_JOINER.join(RoleType.RELEASE_NAMESPACE, appId, namespaceName, env);
}
public static String buildNamespaceRoleName(String appId, String namespaceName, String roleType) {
return buildNamespaceRoleName(appId, namespaceName, roleType, null);
}
public static String buildNamespaceRoleName(String appId, String namespaceName, String roleType, String env) {
return STRING_JOINER.join(roleType, appId, namespaceName, env);
}
public static String buildReleaseDefaultNamespaceRoleName(String appId) {
return STRING_JOINER.join(RoleType.RELEASE_NAMESPACE, appId, ConfigConsts.NAMESPACE_APPLICATION);
}
public static String buildNamespaceTargetId(String appId, String namespaceName) {
return buildNamespaceTargetId(appId, namespaceName, null);
}
public static String buildNamespaceTargetId(String appId, String namespaceName, String env) {
return STRING_JOINER.join(appId, namespaceName, env);
}
public static String buildDefaultNamespaceTargetId(String appId) {
return STRING_JOINER.join(appId, ConfigConsts.NAMESPACE_APPLICATION);
}
public static String buildCreateApplicationRoleName(String permissionType, String permissionTargetId) {
return STRING_JOINER.join(permissionType, permissionTargetId);
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultMetaServerProvider.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.internals;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.spi.MetaServerProvider;
import com.ctrip.framework.foundation.Foundation;
import com.google.common.base.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DefaultMetaServerProvider implements MetaServerProvider {
public static final int ORDER = 0;
private static final Logger logger = LoggerFactory.getLogger(DefaultMetaServerProvider.class);
private final String metaServerAddress;
public DefaultMetaServerProvider() {
metaServerAddress = initMetaServerAddress();
}
private String initMetaServerAddress() {
// 1. Get from System Property
String metaAddress = System.getProperty(ConfigConsts.APOLLO_META_KEY);
if (Strings.isNullOrEmpty(metaAddress)) {
// 2. Get from OS environment variable, which could not contain dot and is normally in UPPER case
metaAddress = System.getenv("APOLLO_META");
}
if (Strings.isNullOrEmpty(metaAddress)) {
// 3. Get from server.properties
metaAddress = Foundation.server().getProperty(ConfigConsts.APOLLO_META_KEY, null);
}
if (Strings.isNullOrEmpty(metaAddress)) {
// 4. Get from app.properties
metaAddress = Foundation.app().getProperty(ConfigConsts.APOLLO_META_KEY, null);
}
if (Strings.isNullOrEmpty(metaAddress)) {
logger.warn("Could not find meta server address, because it is not available in neither (1) JVM system property 'apollo.meta', (2) OS env variable 'APOLLO_META' (3) property 'apollo.meta' from server.properties nor (4) property 'apollo.meta' from app.properties");
} else {
metaAddress = metaAddress.trim();
logger.info("Located meta services from apollo.meta configuration: {}!", metaAddress);
}
return metaAddress;
}
@Override
public String getMetaServerAddress(Env targetEnv) {
//for default meta server provider, we don't care the actual environment
return metaServerAddress;
}
@Override
public int getOrder() {
return ORDER;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.internals;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.spi.MetaServerProvider;
import com.ctrip.framework.foundation.Foundation;
import com.google.common.base.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DefaultMetaServerProvider implements MetaServerProvider {
public static final int ORDER = 0;
private static final Logger logger = LoggerFactory.getLogger(DefaultMetaServerProvider.class);
private final String metaServerAddress;
public DefaultMetaServerProvider() {
metaServerAddress = initMetaServerAddress();
}
private String initMetaServerAddress() {
// 1. Get from System Property
String metaAddress = System.getProperty(ConfigConsts.APOLLO_META_KEY);
if (Strings.isNullOrEmpty(metaAddress)) {
// 2. Get from OS environment variable, which could not contain dot and is normally in UPPER case
metaAddress = System.getenv("APOLLO_META");
}
if (Strings.isNullOrEmpty(metaAddress)) {
// 3. Get from server.properties
metaAddress = Foundation.server().getProperty(ConfigConsts.APOLLO_META_KEY, null);
}
if (Strings.isNullOrEmpty(metaAddress)) {
// 4. Get from app.properties
metaAddress = Foundation.app().getProperty(ConfigConsts.APOLLO_META_KEY, null);
}
if (Strings.isNullOrEmpty(metaAddress)) {
logger.warn("Could not find meta server address, because it is not available in neither (1) JVM system property 'apollo.meta', (2) OS env variable 'APOLLO_META' (3) property 'apollo.meta' from server.properties nor (4) property 'apollo.meta' from app.properties");
} else {
metaAddress = metaAddress.trim();
logger.info("Located meta services from apollo.meta configuration: {}!", metaAddress);
}
return metaAddress;
}
@Override
public String getMetaServerAddress(Env targetEnv) {
//for default meta server provider, we don't care the actual environment
return metaServerAddress;
}
@Override
public int getOrder() {
return ORDER;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/DefaultPortalMetaServerProvider.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.environment;
import static com.ctrip.framework.apollo.portal.environment.Env.transformToEnvMap;
import com.ctrip.framework.apollo.core.utils.ResourceUtils;
import com.ctrip.framework.apollo.portal.util.KeyValueUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
/**
* Only use in apollo-portal
* load all meta server address from
* - System Property [key ends with "_meta" (case insensitive)]
* - OS environment variable [key ends with "_meta" (case insensitive)]
* - user's configuration file [key ends with ".meta" (case insensitive)]
* when apollo-portal start up.
* @see com.ctrip.framework.apollo.core.internals.LegacyMetaServerProvider
* @author wxq
*/
class DefaultPortalMetaServerProvider implements PortalMetaServerProvider {
private static final Logger logger = LoggerFactory.getLogger(DefaultPortalMetaServerProvider.class);
/**
* environments and their meta server address
* properties file path
*/
private static final String APOLLO_ENV_PROPERTIES_FILE_PATH = "apollo-env.properties";
private volatile Map<Env, String> domains;
DefaultPortalMetaServerProvider() {
reload();
}
@Override
public String getMetaServerAddress(Env targetEnv) {
String metaServerAddress = domains.get(targetEnv);
return metaServerAddress == null ? null : metaServerAddress.trim();
}
@Override
public boolean exists(Env targetEnv) {
return domains.containsKey(targetEnv);
}
@Override
public void reload() {
domains = initializeDomains();
logger.info("Loaded meta server addresses from system property, os environment and properties file: {}", domains);
}
/**
* load all environment's meta address dynamically when this class loaded by JVM
*/
private Map<Env, String> initializeDomains() {
// add to domain
Map<Env, String> map = new ConcurrentHashMap<>();
// lower priority add first
map.putAll(getDomainsFromPropertiesFile());
map.putAll(getDomainsFromOSEnvironment());
map.putAll(getDomainsFromSystemProperty());
// log all
return map;
}
private Map<Env, String> getDomainsFromSystemProperty() {
// find key-value from System Property which key ends with "_meta" (case insensitive)
Map<String, String> metaServerAddressesFromSystemProperty = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(System.getProperties(), "_meta");
// remove key's suffix "_meta" (case insensitive)
metaServerAddressesFromSystemProperty = KeyValueUtils.removeKeySuffix(metaServerAddressesFromSystemProperty, "_meta".length());
return transformToEnvMap(metaServerAddressesFromSystemProperty);
}
private Map<Env, String> getDomainsFromOSEnvironment() {
// find key-value from OS environment variable which key ends with "_meta" (case insensitive)
Map<String, String> metaServerAddressesFromOSEnvironment = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(System.getenv(), "_meta");
// remove key's suffix "_meta" (case insensitive)
metaServerAddressesFromOSEnvironment = KeyValueUtils.removeKeySuffix(metaServerAddressesFromOSEnvironment, "_meta".length());
return transformToEnvMap(metaServerAddressesFromOSEnvironment);
}
private Map<Env, String> getDomainsFromPropertiesFile() {
// find key-value from properties file which key ends with ".meta" (case insensitive)
Properties properties = new Properties();
properties = ResourceUtils.readConfigFile(APOLLO_ENV_PROPERTIES_FILE_PATH, properties);
Map<String, String> metaServerAddressesFromPropertiesFile = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(properties, ".meta");
// remove key's suffix ".meta" (case insensitive)
metaServerAddressesFromPropertiesFile = KeyValueUtils.removeKeySuffix(metaServerAddressesFromPropertiesFile, ".meta".length());
return transformToEnvMap(metaServerAddressesFromPropertiesFile);
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.environment;
import static com.ctrip.framework.apollo.portal.environment.Env.transformToEnvMap;
import com.ctrip.framework.apollo.core.utils.ResourceUtils;
import com.ctrip.framework.apollo.portal.util.KeyValueUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
/**
* Only use in apollo-portal
* load all meta server address from
* - System Property [key ends with "_meta" (case insensitive)]
* - OS environment variable [key ends with "_meta" (case insensitive)]
* - user's configuration file [key ends with ".meta" (case insensitive)]
* when apollo-portal start up.
* @see com.ctrip.framework.apollo.core.internals.LegacyMetaServerProvider
* @author wxq
*/
class DefaultPortalMetaServerProvider implements PortalMetaServerProvider {
private static final Logger logger = LoggerFactory.getLogger(DefaultPortalMetaServerProvider.class);
/**
* environments and their meta server address
* properties file path
*/
private static final String APOLLO_ENV_PROPERTIES_FILE_PATH = "apollo-env.properties";
private volatile Map<Env, String> domains;
DefaultPortalMetaServerProvider() {
reload();
}
@Override
public String getMetaServerAddress(Env targetEnv) {
String metaServerAddress = domains.get(targetEnv);
return metaServerAddress == null ? null : metaServerAddress.trim();
}
@Override
public boolean exists(Env targetEnv) {
return domains.containsKey(targetEnv);
}
@Override
public void reload() {
domains = initializeDomains();
logger.info("Loaded meta server addresses from system property, os environment and properties file: {}", domains);
}
/**
* load all environment's meta address dynamically when this class loaded by JVM
*/
private Map<Env, String> initializeDomains() {
// add to domain
Map<Env, String> map = new ConcurrentHashMap<>();
// lower priority add first
map.putAll(getDomainsFromPropertiesFile());
map.putAll(getDomainsFromOSEnvironment());
map.putAll(getDomainsFromSystemProperty());
// log all
return map;
}
private Map<Env, String> getDomainsFromSystemProperty() {
// find key-value from System Property which key ends with "_meta" (case insensitive)
Map<String, String> metaServerAddressesFromSystemProperty = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(System.getProperties(), "_meta");
// remove key's suffix "_meta" (case insensitive)
metaServerAddressesFromSystemProperty = KeyValueUtils.removeKeySuffix(metaServerAddressesFromSystemProperty, "_meta".length());
return transformToEnvMap(metaServerAddressesFromSystemProperty);
}
private Map<Env, String> getDomainsFromOSEnvironment() {
// find key-value from OS environment variable which key ends with "_meta" (case insensitive)
Map<String, String> metaServerAddressesFromOSEnvironment = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(System.getenv(), "_meta");
// remove key's suffix "_meta" (case insensitive)
metaServerAddressesFromOSEnvironment = KeyValueUtils.removeKeySuffix(metaServerAddressesFromOSEnvironment, "_meta".length());
return transformToEnvMap(metaServerAddressesFromOSEnvironment);
}
private Map<Env, String> getDomainsFromPropertiesFile() {
// find key-value from properties file which key ends with ".meta" (case insensitive)
Properties properties = new Properties();
properties = ResourceUtils.readConfigFile(APOLLO_ENV_PROPERTIES_FILE_PATH, properties);
Map<String, String> metaServerAddressesFromPropertiesFile = KeyValueUtils.filterWithKeyIgnoreCaseEndsWith(properties, ".meta");
// remove key's suffix ".meta" (case insensitive)
metaServerAddressesFromPropertiesFile = KeyValueUtils.removeKeySuffix(metaServerAddressesFromPropertiesFile, ".meta".length());
return transformToEnvMap(metaServerAddressesFromPropertiesFile);
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/ServiceExceptionTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal;
import com.ctrip.framework.apollo.common.exception.ServiceException;
import com.ctrip.framework.apollo.portal.controller.AppController;
import com.ctrip.framework.apollo.portal.entity.model.AppModel;
import com.ctrip.framework.apollo.portal.service.AppService;
import com.google.gson.Gson;
import java.nio.charset.Charset;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpServerErrorException;
import org.springframework.web.client.HttpStatusCodeException;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
public class ServiceExceptionTest extends AbstractUnitTest {
@InjectMocks
private AppController appController;
@Mock
private AppService appService;
private static final Gson GSON = new Gson();
@Test
public void testAdminServiceException() {
String errorMsg = "No available admin service";
String errorCode = "errorCode";
String status = "500";
Map<String, Object> errorAttributes = new LinkedHashMap<>();
errorAttributes.put("status", status);
errorAttributes.put("message", errorMsg);
errorAttributes.put("timestamp",
LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
errorAttributes.put("exception", ServiceException.class.getName());
errorAttributes.put("errorCode", errorCode);
HttpStatusCodeException adminException =
new HttpServerErrorException(
HttpStatus.INTERNAL_SERVER_ERROR, "admin server error", GSON.toJson(errorAttributes).getBytes(),
Charset.defaultCharset()
);
when(appService.createAppInLocal(any())).thenThrow(adminException);
AppModel app = generateSampleApp();
try {
appController.create(app);
} catch (HttpStatusCodeException e) {
@SuppressWarnings("unchecked")
Map<String, String> attr = new Gson().fromJson(e.getResponseBodyAsString(), Map.class);
Assert.assertEquals(errorMsg, attr.get("message"));
Assert.assertEquals(errorCode, attr.get("errorCode"));
Assert.assertEquals(status, attr.get("status"));
}
}
private AppModel generateSampleApp() {
AppModel app = new AppModel();
app.setAppId("someAppId");
app.setName("someName");
app.setOrgId("someOrgId");
app.setOrgName("someOrgNam");
app.setOwnerName("someOwner");
return app;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal;
import com.ctrip.framework.apollo.common.exception.ServiceException;
import com.ctrip.framework.apollo.portal.controller.AppController;
import com.ctrip.framework.apollo.portal.entity.model.AppModel;
import com.ctrip.framework.apollo.portal.service.AppService;
import com.google.gson.Gson;
import java.nio.charset.Charset;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpServerErrorException;
import org.springframework.web.client.HttpStatusCodeException;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
public class ServiceExceptionTest extends AbstractUnitTest {
@InjectMocks
private AppController appController;
@Mock
private AppService appService;
private static final Gson GSON = new Gson();
@Test
public void testAdminServiceException() {
String errorMsg = "No available admin service";
String errorCode = "errorCode";
String status = "500";
Map<String, Object> errorAttributes = new LinkedHashMap<>();
errorAttributes.put("status", status);
errorAttributes.put("message", errorMsg);
errorAttributes.put("timestamp",
LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
errorAttributes.put("exception", ServiceException.class.getName());
errorAttributes.put("errorCode", errorCode);
HttpStatusCodeException adminException =
new HttpServerErrorException(
HttpStatus.INTERNAL_SERVER_ERROR, "admin server error", GSON.toJson(errorAttributes).getBytes(),
Charset.defaultCharset()
);
when(appService.createAppInLocal(any())).thenThrow(adminException);
AppModel app = generateSampleApp();
try {
appController.create(app);
} catch (HttpStatusCodeException e) {
@SuppressWarnings("unchecked")
Map<String, String> attr = new Gson().fromJson(e.getResponseBodyAsString(), Map.class);
Assert.assertEquals(errorMsg, attr.get("message"));
Assert.assertEquals(errorCode, attr.get("errorCode"));
Assert.assertEquals(status, attr.get("status"));
}
}
private AppModel generateSampleApp() {
AppModel app = new AppModel();
app.setAppId("someAppId");
app.setName("someName");
app.setOrgId("someOrgId");
app.setOrgName("someOrgNam");
app.setOwnerName("someOwner");
return app;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/service/NamespaceBranchServiceTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.biz.service;
import com.ctrip.framework.apollo.biz.AbstractIntegrationTest;
import com.ctrip.framework.apollo.biz.entity.GrayReleaseRule;
import com.ctrip.framework.apollo.biz.entity.Namespace;
import com.ctrip.framework.apollo.biz.entity.ReleaseHistory;
import com.ctrip.framework.apollo.common.constants.NamespaceBranchStatus;
import com.ctrip.framework.apollo.common.constants.ReleaseOperation;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.test.context.jdbc.Sql;
public class NamespaceBranchServiceTest extends AbstractIntegrationTest {
@Autowired
private NamespaceBranchService namespaceBranchService;
@Autowired
private ReleaseHistoryService releaseHistoryService;
private String testApp = "test";
private String testCluster = "default";
private String testNamespace = "application";
private String testBranchName = "child-cluster";
private String operator = "apollo";
private Pageable pageable = PageRequest.of(0, 10);
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testFindBranch() {
Namespace branch = namespaceBranchService.findBranch(testApp, testCluster, testNamespace);
Assert.assertNotNull(branch);
Assert.assertEquals(testBranchName, branch.getClusterName());
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateBranchGrayRulesWithUpdateOnce() {
GrayReleaseRule rule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, rule);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(activeRule);
Assert.assertEquals(rule.getAppId(), activeRule.getAppId());
Assert.assertEquals(rule.getRules(), activeRule.getRules());
Assert.assertEquals(Long.valueOf(0), activeRule.getReleaseId());
Page<ReleaseHistory> releaseHistories = releaseHistoryService.findReleaseHistoriesByNamespace
(testApp, testCluster, testNamespace, pageable);
ReleaseHistory releaseHistory = releaseHistories.getContent().get(0);
Assert.assertEquals(1, releaseHistories.getTotalElements());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, releaseHistory.getOperation());
Assert.assertEquals(0, releaseHistory.getReleaseId());
Assert.assertEquals(0, releaseHistory.getPreviousReleaseId());
Assert.assertTrue(releaseHistory.getOperationContext().contains(rule.getRules()));
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateBranchGrayRulesWithUpdateTwice() {
GrayReleaseRule firstRule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, firstRule);
GrayReleaseRule secondRule = instanceGrayReleaseRule();
secondRule.setRules("[{\"clientAppId\":\"branch-test\",\"clientIpList\":[\"10.38.57.112\"]}]");
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, secondRule);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(secondRule);
Assert.assertEquals(secondRule.getAppId(), activeRule.getAppId());
Assert.assertEquals(secondRule.getRules(), activeRule.getRules());
Assert.assertEquals(Long.valueOf(0), activeRule.getReleaseId());
Page<ReleaseHistory> releaseHistories = releaseHistoryService.findReleaseHistoriesByNamespace
(testApp, testCluster, testNamespace, pageable);
ReleaseHistory firstReleaseHistory = releaseHistories.getContent().get(1);
ReleaseHistory secondReleaseHistory = releaseHistories.getContent().get(0);
Assert.assertEquals(2, releaseHistories.getTotalElements());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, firstReleaseHistory.getOperation());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, secondReleaseHistory.getOperation());
Assert.assertTrue(firstReleaseHistory.getOperationContext().contains(firstRule.getRules()));
Assert.assertFalse(firstReleaseHistory.getOperationContext().contains(secondRule.getRules()));
Assert.assertTrue(secondReleaseHistory.getOperationContext().contains(firstRule.getRules()));
Assert.assertTrue(secondReleaseHistory.getOperationContext().contains(secondRule.getRules()));
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateRulesReleaseIdWithOldRuleNotExist() {
long latestReleaseId = 100;
namespaceBranchService
.updateRulesReleaseId(testApp, testCluster, testNamespace, testBranchName, latestReleaseId, operator);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNull(activeRule);
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateRulesReleaseIdWithOldRuleExist() {
GrayReleaseRule rule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, rule);
long latestReleaseId = 100;
namespaceBranchService
.updateRulesReleaseId(testApp, testCluster, testNamespace, testBranchName, latestReleaseId, operator);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(activeRule);
Assert.assertEquals(Long.valueOf(latestReleaseId), activeRule.getReleaseId());
Assert.assertEquals(rule.getRules(), activeRule.getRules());
Assert.assertEquals(NamespaceBranchStatus.ACTIVE, activeRule.getBranchStatus());
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testDeleteBranch() {
GrayReleaseRule rule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, rule);
namespaceBranchService.deleteBranch(testApp, testCluster, testNamespace, testBranchName, NamespaceBranchStatus.DELETED, operator);
Namespace branch = namespaceBranchService.findBranch(testApp, testCluster, testNamespace);
Assert.assertNull(branch);
GrayReleaseRule latestRule = namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(latestRule);
Assert.assertEquals(NamespaceBranchStatus.DELETED, latestRule.getBranchStatus());
Assert.assertEquals("[]", latestRule.getRules());
Page<ReleaseHistory> releaseHistories = releaseHistoryService.findReleaseHistoriesByNamespace
(testApp, testCluster, testNamespace, pageable);
ReleaseHistory firstReleaseHistory = releaseHistories.getContent().get(1);
ReleaseHistory secondReleaseHistory = releaseHistories.getContent().get(0);
Assert.assertEquals(2, releaseHistories.getTotalElements());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, firstReleaseHistory.getOperation());
Assert.assertEquals(ReleaseOperation.ABANDON_GRAY_RELEASE, secondReleaseHistory.getOperation());
}
private GrayReleaseRule instanceGrayReleaseRule() {
GrayReleaseRule rule = new GrayReleaseRule();
rule.setAppId(testApp);
rule.setClusterName(testCluster);
rule.setNamespaceName(testNamespace);
rule.setBranchName(testBranchName);
rule.setBranchStatus(NamespaceBranchStatus.ACTIVE);
rule.setRules("[{\"clientAppId\":\"test\",\"clientIpList\":[\"1.0.0.4\"]}]");
return rule;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.biz.service;
import com.ctrip.framework.apollo.biz.AbstractIntegrationTest;
import com.ctrip.framework.apollo.biz.entity.GrayReleaseRule;
import com.ctrip.framework.apollo.biz.entity.Namespace;
import com.ctrip.framework.apollo.biz.entity.ReleaseHistory;
import com.ctrip.framework.apollo.common.constants.NamespaceBranchStatus;
import com.ctrip.framework.apollo.common.constants.ReleaseOperation;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.test.context.jdbc.Sql;
public class NamespaceBranchServiceTest extends AbstractIntegrationTest {
@Autowired
private NamespaceBranchService namespaceBranchService;
@Autowired
private ReleaseHistoryService releaseHistoryService;
private String testApp = "test";
private String testCluster = "default";
private String testNamespace = "application";
private String testBranchName = "child-cluster";
private String operator = "apollo";
private Pageable pageable = PageRequest.of(0, 10);
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testFindBranch() {
Namespace branch = namespaceBranchService.findBranch(testApp, testCluster, testNamespace);
Assert.assertNotNull(branch);
Assert.assertEquals(testBranchName, branch.getClusterName());
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateBranchGrayRulesWithUpdateOnce() {
GrayReleaseRule rule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, rule);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(activeRule);
Assert.assertEquals(rule.getAppId(), activeRule.getAppId());
Assert.assertEquals(rule.getRules(), activeRule.getRules());
Assert.assertEquals(Long.valueOf(0), activeRule.getReleaseId());
Page<ReleaseHistory> releaseHistories = releaseHistoryService.findReleaseHistoriesByNamespace
(testApp, testCluster, testNamespace, pageable);
ReleaseHistory releaseHistory = releaseHistories.getContent().get(0);
Assert.assertEquals(1, releaseHistories.getTotalElements());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, releaseHistory.getOperation());
Assert.assertEquals(0, releaseHistory.getReleaseId());
Assert.assertEquals(0, releaseHistory.getPreviousReleaseId());
Assert.assertTrue(releaseHistory.getOperationContext().contains(rule.getRules()));
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateBranchGrayRulesWithUpdateTwice() {
GrayReleaseRule firstRule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, firstRule);
GrayReleaseRule secondRule = instanceGrayReleaseRule();
secondRule.setRules("[{\"clientAppId\":\"branch-test\",\"clientIpList\":[\"10.38.57.112\"]}]");
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, secondRule);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(secondRule);
Assert.assertEquals(secondRule.getAppId(), activeRule.getAppId());
Assert.assertEquals(secondRule.getRules(), activeRule.getRules());
Assert.assertEquals(Long.valueOf(0), activeRule.getReleaseId());
Page<ReleaseHistory> releaseHistories = releaseHistoryService.findReleaseHistoriesByNamespace
(testApp, testCluster, testNamespace, pageable);
ReleaseHistory firstReleaseHistory = releaseHistories.getContent().get(1);
ReleaseHistory secondReleaseHistory = releaseHistories.getContent().get(0);
Assert.assertEquals(2, releaseHistories.getTotalElements());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, firstReleaseHistory.getOperation());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, secondReleaseHistory.getOperation());
Assert.assertTrue(firstReleaseHistory.getOperationContext().contains(firstRule.getRules()));
Assert.assertFalse(firstReleaseHistory.getOperationContext().contains(secondRule.getRules()));
Assert.assertTrue(secondReleaseHistory.getOperationContext().contains(firstRule.getRules()));
Assert.assertTrue(secondReleaseHistory.getOperationContext().contains(secondRule.getRules()));
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateRulesReleaseIdWithOldRuleNotExist() {
long latestReleaseId = 100;
namespaceBranchService
.updateRulesReleaseId(testApp, testCluster, testNamespace, testBranchName, latestReleaseId, operator);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNull(activeRule);
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testUpdateRulesReleaseIdWithOldRuleExist() {
GrayReleaseRule rule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, rule);
long latestReleaseId = 100;
namespaceBranchService
.updateRulesReleaseId(testApp, testCluster, testNamespace, testBranchName, latestReleaseId, operator);
GrayReleaseRule
activeRule =
namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(activeRule);
Assert.assertEquals(Long.valueOf(latestReleaseId), activeRule.getReleaseId());
Assert.assertEquals(rule.getRules(), activeRule.getRules());
Assert.assertEquals(NamespaceBranchStatus.ACTIVE, activeRule.getBranchStatus());
}
@Test
@Sql(scripts = "/sql/namespace-branch-test.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
public void testDeleteBranch() {
GrayReleaseRule rule = instanceGrayReleaseRule();
namespaceBranchService.updateBranchGrayRules(testApp, testCluster, testNamespace, testBranchName, rule);
namespaceBranchService.deleteBranch(testApp, testCluster, testNamespace, testBranchName, NamespaceBranchStatus.DELETED, operator);
Namespace branch = namespaceBranchService.findBranch(testApp, testCluster, testNamespace);
Assert.assertNull(branch);
GrayReleaseRule latestRule = namespaceBranchService.findBranchGrayRules(testApp, testCluster, testNamespace, testBranchName);
Assert.assertNotNull(latestRule);
Assert.assertEquals(NamespaceBranchStatus.DELETED, latestRule.getBranchStatus());
Assert.assertEquals("[]", latestRule.getRules());
Page<ReleaseHistory> releaseHistories = releaseHistoryService.findReleaseHistoriesByNamespace
(testApp, testCluster, testNamespace, pageable);
ReleaseHistory firstReleaseHistory = releaseHistories.getContent().get(1);
ReleaseHistory secondReleaseHistory = releaseHistories.getContent().get(0);
Assert.assertEquals(2, releaseHistories.getTotalElements());
Assert.assertEquals(ReleaseOperation.APPLY_GRAY_RULES, firstReleaseHistory.getOperation());
Assert.assertEquals(ReleaseOperation.ABANDON_GRAY_RELEASE, secondReleaseHistory.getOperation());
}
private GrayReleaseRule instanceGrayReleaseRule() {
GrayReleaseRule rule = new GrayReleaseRule();
rule.setAppId(testApp);
rule.setClusterName(testCluster);
rule.setNamespaceName(testNamespace);
rule.setBranchName(testBranchName);
rule.setBranchStatus(NamespaceBranchStatus.ACTIVE);
rule.setRules("[{\"clientAppId\":\"test\",\"clientIpList\":[\"1.0.0.4\"]}]");
return rule;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-client/src/test/java/com/ctrip/framework/apollo/spi/DefaultConfigFactoryTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.spi;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.internals.PropertiesCompatibleFileConfigRepository;
import java.util.Properties;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.test.util.ReflectionTestUtils;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigFile;
import com.ctrip.framework.apollo.build.MockInjector;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.internals.DefaultConfig;
import com.ctrip.framework.apollo.internals.JsonConfigFile;
import com.ctrip.framework.apollo.internals.LocalFileConfigRepository;
import com.ctrip.framework.apollo.internals.PropertiesConfigFile;
import com.ctrip.framework.apollo.internals.XmlConfigFile;
import com.ctrip.framework.apollo.internals.YamlConfigFile;
import com.ctrip.framework.apollo.internals.YmlConfigFile;
import com.ctrip.framework.apollo.util.ConfigUtil;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class DefaultConfigFactoryTest {
private DefaultConfigFactory defaultConfigFactory;
private static String someAppId;
private static Env someEnv;
@Before
public void setUp() throws Exception {
someAppId = "someId";
someEnv = Env.DEV;
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtil());
defaultConfigFactory = spy(new DefaultConfigFactory());
}
@After
public void tearDown() throws Exception {
MockInjector.reset();
}
@Test
public void testCreate() throws Exception {
String someNamespace = "someName";
Properties someProperties = new Properties();
String someKey = "someKey";
String someValue = "someValue";
someProperties.setProperty(someKey, someValue);
LocalFileConfigRepository someLocalConfigRepo = mock(LocalFileConfigRepository.class);
when(someLocalConfigRepo.getConfig()).thenReturn(someProperties);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(someNamespace);
Config result = defaultConfigFactory.create(someNamespace);
assertThat("DefaultConfigFactory should create DefaultConfig", result,
is(instanceOf(DefaultConfig.class)));
assertEquals(someValue, result.getProperty(someKey, null));
}
@Test
public void testCreateLocalConfigRepositoryInLocalDev() throws Exception {
String someNamespace = "someName";
someEnv = Env.LOCAL;
LocalFileConfigRepository localFileConfigRepository =
defaultConfigFactory.createLocalConfigRepository(someNamespace);
assertNull(ReflectionTestUtils.getField(localFileConfigRepository, "m_upstream"));
}
@Test
public void testCreatePropertiesCompatibleFileConfigRepository() throws Exception {
ConfigFileFormat somePropertiesCompatibleFormat = ConfigFileFormat.YML;
String someNamespace = "someName" + "." + somePropertiesCompatibleFormat;
Properties someProperties = new Properties();
String someKey = "someKey";
String someValue = "someValue";
someProperties.setProperty(someKey, someValue);
PropertiesCompatibleFileConfigRepository someRepository = mock(PropertiesCompatibleFileConfigRepository.class);
when(someRepository.getConfig()).thenReturn(someProperties);
doReturn(someRepository).when(defaultConfigFactory)
.createPropertiesCompatibleFileConfigRepository(someNamespace, somePropertiesCompatibleFormat);
Config result = defaultConfigFactory.create(someNamespace);
assertThat("DefaultConfigFactory should create DefaultConfig", result,
is(instanceOf(DefaultConfig.class)));
assertEquals(someValue, result.getProperty(someKey, null));
}
@Test
public void testCreateConfigFile() throws Exception {
String someNamespace = "someName";
String anotherNamespace = "anotherName";
String yetAnotherNamespace = "yetAnotherNamespace";
Properties someProperties = new Properties();
LocalFileConfigRepository someLocalConfigRepo = mock(LocalFileConfigRepository.class);
when(someLocalConfigRepo.getConfig()).thenReturn(someProperties);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(someNamespace);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(anotherNamespace);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(yetAnotherNamespace);
ConfigFile propertyConfigFile =
defaultConfigFactory.createConfigFile(someNamespace, ConfigFileFormat.Properties);
ConfigFile xmlConfigFile =
defaultConfigFactory.createConfigFile(anotherNamespace, ConfigFileFormat.XML);
ConfigFile jsonConfigFile =
defaultConfigFactory.createConfigFile(yetAnotherNamespace, ConfigFileFormat.JSON);
ConfigFile ymlConfigFile = defaultConfigFactory.createConfigFile(someNamespace,
ConfigFileFormat.YML);
ConfigFile yamlConfigFile = defaultConfigFactory.createConfigFile(someNamespace,
ConfigFileFormat.YAML);
assertThat("Should create PropertiesConfigFile for properties format", propertyConfigFile, is(instanceOf(
PropertiesConfigFile.class)));
assertEquals(someNamespace, propertyConfigFile.getNamespace());
assertThat("Should create XmlConfigFile for xml format", xmlConfigFile, is(instanceOf(
XmlConfigFile.class)));
assertEquals(anotherNamespace, xmlConfigFile.getNamespace());
assertThat("Should create JsonConfigFile for json format", jsonConfigFile, is(instanceOf(
JsonConfigFile.class)));
assertEquals(yetAnotherNamespace, jsonConfigFile.getNamespace());
assertThat("Should create YmlConfigFile for yml format", ymlConfigFile, is(instanceOf(
YmlConfigFile.class)));
assertEquals(someNamespace, ymlConfigFile.getNamespace());
assertThat("Should create YamlConfigFile for yaml format", yamlConfigFile, is(instanceOf(
YamlConfigFile.class)));
assertEquals(someNamespace, yamlConfigFile.getNamespace());
}
@Test
public void testDetermineFileFormat() throws Exception {
checkFileFormat("abc", ConfigFileFormat.Properties);
checkFileFormat("abc.properties", ConfigFileFormat.Properties);
checkFileFormat("abc.pRopErties", ConfigFileFormat.Properties);
checkFileFormat("abc.xml", ConfigFileFormat.XML);
checkFileFormat("abc.xmL", ConfigFileFormat.XML);
checkFileFormat("abc.json", ConfigFileFormat.JSON);
checkFileFormat("abc.jsOn", ConfigFileFormat.JSON);
checkFileFormat("abc.yaml", ConfigFileFormat.YAML);
checkFileFormat("abc.yAml", ConfigFileFormat.YAML);
checkFileFormat("abc.yml", ConfigFileFormat.YML);
checkFileFormat("abc.yMl", ConfigFileFormat.YML);
checkFileFormat("abc.properties.yml", ConfigFileFormat.YML);
}
@Test
public void testTrimNamespaceFormat() throws Exception {
checkNamespaceName("abc", ConfigFileFormat.Properties, "abc");
checkNamespaceName("abc.properties", ConfigFileFormat.Properties, "abc");
checkNamespaceName("abcproperties", ConfigFileFormat.Properties, "abcproperties");
checkNamespaceName("abc.pRopErties", ConfigFileFormat.Properties, "abc");
checkNamespaceName("abc.xml", ConfigFileFormat.XML, "abc");
checkNamespaceName("abc.xmL", ConfigFileFormat.XML, "abc");
checkNamespaceName("abc.json", ConfigFileFormat.JSON, "abc");
checkNamespaceName("abc.jsOn", ConfigFileFormat.JSON, "abc");
checkNamespaceName("abc.yaml", ConfigFileFormat.YAML, "abc");
checkNamespaceName("abc.yAml", ConfigFileFormat.YAML, "abc");
checkNamespaceName("abc.yml", ConfigFileFormat.YML, "abc");
checkNamespaceName("abc.yMl", ConfigFileFormat.YML, "abc");
checkNamespaceName("abc.proPerties.yml", ConfigFileFormat.YML, "abc.proPerties");
}
private void checkFileFormat(String namespaceName, ConfigFileFormat expectedFormat) {
assertEquals(expectedFormat, defaultConfigFactory.determineFileFormat(namespaceName));
}
private void checkNamespaceName(String namespaceName, ConfigFileFormat format, String expectedNamespaceName) {
assertEquals(expectedNamespaceName, defaultConfigFactory.trimNamespaceFormat(namespaceName, format));
}
public static class MockConfigUtil extends ConfigUtil {
@Override
public String getAppId() {
return someAppId;
}
@Override
public Env getApolloEnv() {
return someEnv;
}
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.spi;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.internals.PropertiesCompatibleFileConfigRepository;
import java.util.Properties;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.test.util.ReflectionTestUtils;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigFile;
import com.ctrip.framework.apollo.build.MockInjector;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.internals.DefaultConfig;
import com.ctrip.framework.apollo.internals.JsonConfigFile;
import com.ctrip.framework.apollo.internals.LocalFileConfigRepository;
import com.ctrip.framework.apollo.internals.PropertiesConfigFile;
import com.ctrip.framework.apollo.internals.XmlConfigFile;
import com.ctrip.framework.apollo.internals.YamlConfigFile;
import com.ctrip.framework.apollo.internals.YmlConfigFile;
import com.ctrip.framework.apollo.util.ConfigUtil;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class DefaultConfigFactoryTest {
private DefaultConfigFactory defaultConfigFactory;
private static String someAppId;
private static Env someEnv;
@Before
public void setUp() throws Exception {
someAppId = "someId";
someEnv = Env.DEV;
MockInjector.setInstance(ConfigUtil.class, new MockConfigUtil());
defaultConfigFactory = spy(new DefaultConfigFactory());
}
@After
public void tearDown() throws Exception {
MockInjector.reset();
}
@Test
public void testCreate() throws Exception {
String someNamespace = "someName";
Properties someProperties = new Properties();
String someKey = "someKey";
String someValue = "someValue";
someProperties.setProperty(someKey, someValue);
LocalFileConfigRepository someLocalConfigRepo = mock(LocalFileConfigRepository.class);
when(someLocalConfigRepo.getConfig()).thenReturn(someProperties);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(someNamespace);
Config result = defaultConfigFactory.create(someNamespace);
assertThat("DefaultConfigFactory should create DefaultConfig", result,
is(instanceOf(DefaultConfig.class)));
assertEquals(someValue, result.getProperty(someKey, null));
}
@Test
public void testCreateLocalConfigRepositoryInLocalDev() throws Exception {
String someNamespace = "someName";
someEnv = Env.LOCAL;
LocalFileConfigRepository localFileConfigRepository =
defaultConfigFactory.createLocalConfigRepository(someNamespace);
assertNull(ReflectionTestUtils.getField(localFileConfigRepository, "m_upstream"));
}
@Test
public void testCreatePropertiesCompatibleFileConfigRepository() throws Exception {
ConfigFileFormat somePropertiesCompatibleFormat = ConfigFileFormat.YML;
String someNamespace = "someName" + "." + somePropertiesCompatibleFormat;
Properties someProperties = new Properties();
String someKey = "someKey";
String someValue = "someValue";
someProperties.setProperty(someKey, someValue);
PropertiesCompatibleFileConfigRepository someRepository = mock(PropertiesCompatibleFileConfigRepository.class);
when(someRepository.getConfig()).thenReturn(someProperties);
doReturn(someRepository).when(defaultConfigFactory)
.createPropertiesCompatibleFileConfigRepository(someNamespace, somePropertiesCompatibleFormat);
Config result = defaultConfigFactory.create(someNamespace);
assertThat("DefaultConfigFactory should create DefaultConfig", result,
is(instanceOf(DefaultConfig.class)));
assertEquals(someValue, result.getProperty(someKey, null));
}
@Test
public void testCreateConfigFile() throws Exception {
String someNamespace = "someName";
String anotherNamespace = "anotherName";
String yetAnotherNamespace = "yetAnotherNamespace";
Properties someProperties = new Properties();
LocalFileConfigRepository someLocalConfigRepo = mock(LocalFileConfigRepository.class);
when(someLocalConfigRepo.getConfig()).thenReturn(someProperties);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(someNamespace);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(anotherNamespace);
doReturn(someLocalConfigRepo).when(defaultConfigFactory).createLocalConfigRepository(yetAnotherNamespace);
ConfigFile propertyConfigFile =
defaultConfigFactory.createConfigFile(someNamespace, ConfigFileFormat.Properties);
ConfigFile xmlConfigFile =
defaultConfigFactory.createConfigFile(anotherNamespace, ConfigFileFormat.XML);
ConfigFile jsonConfigFile =
defaultConfigFactory.createConfigFile(yetAnotherNamespace, ConfigFileFormat.JSON);
ConfigFile ymlConfigFile = defaultConfigFactory.createConfigFile(someNamespace,
ConfigFileFormat.YML);
ConfigFile yamlConfigFile = defaultConfigFactory.createConfigFile(someNamespace,
ConfigFileFormat.YAML);
assertThat("Should create PropertiesConfigFile for properties format", propertyConfigFile, is(instanceOf(
PropertiesConfigFile.class)));
assertEquals(someNamespace, propertyConfigFile.getNamespace());
assertThat("Should create XmlConfigFile for xml format", xmlConfigFile, is(instanceOf(
XmlConfigFile.class)));
assertEquals(anotherNamespace, xmlConfigFile.getNamespace());
assertThat("Should create JsonConfigFile for json format", jsonConfigFile, is(instanceOf(
JsonConfigFile.class)));
assertEquals(yetAnotherNamespace, jsonConfigFile.getNamespace());
assertThat("Should create YmlConfigFile for yml format", ymlConfigFile, is(instanceOf(
YmlConfigFile.class)));
assertEquals(someNamespace, ymlConfigFile.getNamespace());
assertThat("Should create YamlConfigFile for yaml format", yamlConfigFile, is(instanceOf(
YamlConfigFile.class)));
assertEquals(someNamespace, yamlConfigFile.getNamespace());
}
@Test
public void testDetermineFileFormat() throws Exception {
checkFileFormat("abc", ConfigFileFormat.Properties);
checkFileFormat("abc.properties", ConfigFileFormat.Properties);
checkFileFormat("abc.pRopErties", ConfigFileFormat.Properties);
checkFileFormat("abc.xml", ConfigFileFormat.XML);
checkFileFormat("abc.xmL", ConfigFileFormat.XML);
checkFileFormat("abc.json", ConfigFileFormat.JSON);
checkFileFormat("abc.jsOn", ConfigFileFormat.JSON);
checkFileFormat("abc.yaml", ConfigFileFormat.YAML);
checkFileFormat("abc.yAml", ConfigFileFormat.YAML);
checkFileFormat("abc.yml", ConfigFileFormat.YML);
checkFileFormat("abc.yMl", ConfigFileFormat.YML);
checkFileFormat("abc.properties.yml", ConfigFileFormat.YML);
}
@Test
public void testTrimNamespaceFormat() throws Exception {
checkNamespaceName("abc", ConfigFileFormat.Properties, "abc");
checkNamespaceName("abc.properties", ConfigFileFormat.Properties, "abc");
checkNamespaceName("abcproperties", ConfigFileFormat.Properties, "abcproperties");
checkNamespaceName("abc.pRopErties", ConfigFileFormat.Properties, "abc");
checkNamespaceName("abc.xml", ConfigFileFormat.XML, "abc");
checkNamespaceName("abc.xmL", ConfigFileFormat.XML, "abc");
checkNamespaceName("abc.json", ConfigFileFormat.JSON, "abc");
checkNamespaceName("abc.jsOn", ConfigFileFormat.JSON, "abc");
checkNamespaceName("abc.yaml", ConfigFileFormat.YAML, "abc");
checkNamespaceName("abc.yAml", ConfigFileFormat.YAML, "abc");
checkNamespaceName("abc.yml", ConfigFileFormat.YML, "abc");
checkNamespaceName("abc.yMl", ConfigFileFormat.YML, "abc");
checkNamespaceName("abc.proPerties.yml", ConfigFileFormat.YML, "abc.proPerties");
}
private void checkFileFormat(String namespaceName, ConfigFileFormat expectedFormat) {
assertEquals(expectedFormat, defaultConfigFactory.determineFileFormat(namespaceName));
}
private void checkNamespaceName(String namespaceName, ConfigFileFormat format, String expectedNamespaceName) {
assertEquals(expectedNamespaceName, defaultConfigFactory.trimNamespaceFormat(namespaceName, format));
}
public static class MockConfigUtil extends ConfigUtil {
@Override
public String getAppId() {
return someAppId;
}
@Override
public Env getApolloEnv() {
return someEnv;
}
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/PageDTO.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.dto;
import org.springframework.data.domain.Pageable;
import java.util.Collections;
import java.util.List;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class PageDTO<T> {
private final long total;
private final List<T> content;
private final int page;
private final int size;
public PageDTO(List<T> content, Pageable pageable, long total) {
this.total = total;
this.content = content;
this.page = pageable.getPageNumber();
this.size = pageable.getPageSize();
}
public long getTotal() {
return total;
}
public List<T> getContent() {
return Collections.unmodifiableList(content);
}
public int getPage() {
return page;
}
public int getSize() {
return size;
}
public boolean hasContent(){
return content != null && content.size() > 0;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.dto;
import org.springframework.data.domain.Pageable;
import java.util.Collections;
import java.util.List;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class PageDTO<T> {
private final long total;
private final List<T> content;
private final int page;
private final int size;
public PageDTO(List<T> content, Pageable pageable, long total) {
this.total = total;
this.content = content;
this.page = pageable.getPageNumber();
this.size = pageable.getPageSize();
}
public long getTotal() {
return total;
}
public List<T> getContent() {
return Collections.unmodifiableList(content);
}
public int getPage() {
return page;
}
public int getSize() {
return size;
}
public boolean hasContent(){
return content != null && content.size() > 0;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-client/src/main/java/com/ctrip/framework/apollo/ConfigFileChangeListener.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo;
import com.ctrip.framework.apollo.model.ConfigFileChangeEvent;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public interface ConfigFileChangeListener {
/**
* Invoked when there is any config change for the namespace.
* @param changeEvent the event for this change
*/
void onChange(ConfigFileChangeEvent changeEvent);
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo;
import com.ctrip.framework.apollo.model.ConfigFileChangeEvent;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public interface ConfigFileChangeListener {
/**
* Invoked when there is any config change for the namespace.
* @param changeEvent the event for this change
*/
void onChange(ConfigFileChangeEvent changeEvent);
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-core/src/test/java/com/ctrip/framework/apollo/core/signature/HmacSha1UtilsTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.core.signature;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/**
* @author nisiyong
*/
public class HmacSha1UtilsTest {
@Test
public void testSignString() {
String stringToSign = "1576478257344\n/configs/100004458/default/application?ip=10.0.0.1";
String accessKeySecret = "df23df3f59884980844ff3dada30fa97";
String actualSignature = HmacSha1Utils.signString(stringToSign, accessKeySecret);
String expectedSignature = "EoKyziXvKqzHgwx+ijDJwgVTDgE=";
assertEquals(expectedSignature, actualSignature);
}
} | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.core.signature;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/**
* @author nisiyong
*/
public class HmacSha1UtilsTest {
@Test
public void testSignString() {
String stringToSign = "1576478257344\n/configs/100004458/default/application?ip=10.0.0.1";
String accessKeySecret = "df23df3f59884980844ff3dada30fa97";
String actualSignature = HmacSha1Utils.signString(stringToSign, accessKeySecret);
String expectedSignature = "EoKyziXvKqzHgwx+ijDJwgVTDgE=";
assertEquals(expectedSignature, actualSignature);
}
} | -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/constants/ReleaseOperation.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.constants;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public interface ReleaseOperation {
int NORMAL_RELEASE = 0;
int ROLLBACK = 1;
int GRAY_RELEASE = 2;
int APPLY_GRAY_RULES = 3;
int GRAY_RELEASE_MERGE_TO_MASTER = 4;
int MASTER_NORMAL_RELEASE_MERGE_TO_GRAY = 5;
int MATER_ROLLBACK_MERGE_TO_GRAY = 6;
int ABANDON_GRAY_RELEASE = 7;
int GRAY_RELEASE_DELETED_AFTER_MERGE = 8;
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.constants;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public interface ReleaseOperation {
int NORMAL_RELEASE = 0;
int ROLLBACK = 1;
int GRAY_RELEASE = 2;
int APPLY_GRAY_RULES = 3;
int GRAY_RELEASE_MERGE_TO_MASTER = 4;
int MASTER_NORMAL_RELEASE_MERGE_TO_GRAY = 5;
int MATER_ROLLBACK_MERGE_TO_GRAY = 6;
int ABANDON_GRAY_RELEASE = 7;
int GRAY_RELEASE_DELETED_AFTER_MERGE = 8;
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property/SpringValueDefinitionProcessor.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.spring.property;
import com.ctrip.framework.apollo.spring.util.SpringInjector;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.TypedStringValue;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import com.ctrip.framework.apollo.build.ApolloInjector;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
/**
* To process xml config placeholders, e.g.
*
* <pre>
* <bean class="com.ctrip.framework.apollo.demo.spring.xmlConfigDemo.bean.XmlBean">
* <property name="timeout" value="${timeout:200}"/>
* <property name="batch" value="${batch:100}"/>
* </bean>
* </pre>
*/
public class SpringValueDefinitionProcessor implements BeanDefinitionRegistryPostProcessor {
private static final Map<BeanDefinitionRegistry, Multimap<String, SpringValueDefinition>> beanName2SpringValueDefinitions =
Maps.newConcurrentMap();
private static final Set<BeanDefinitionRegistry> PROPERTY_VALUES_PROCESSED_BEAN_FACTORIES = Sets.newConcurrentHashSet();
private final ConfigUtil configUtil;
private final PlaceholderHelper placeholderHelper;
public SpringValueDefinitionProcessor() {
configUtil = ApolloInjector.getInstance(ConfigUtil.class);
placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class);
}
@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) {
processPropertyValues(registry);
}
}
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
}
public static Multimap<String, SpringValueDefinition> getBeanName2SpringValueDefinitions(BeanDefinitionRegistry registry) {
Multimap<String, SpringValueDefinition> springValueDefinitions = beanName2SpringValueDefinitions.get(registry);
if (springValueDefinitions == null) {
springValueDefinitions = LinkedListMultimap.create();
}
return springValueDefinitions;
}
private void processPropertyValues(BeanDefinitionRegistry beanRegistry) {
if (!PROPERTY_VALUES_PROCESSED_BEAN_FACTORIES.add(beanRegistry)) {
// already initialized
return;
}
if (!beanName2SpringValueDefinitions.containsKey(beanRegistry)) {
beanName2SpringValueDefinitions.put(beanRegistry, LinkedListMultimap.<String, SpringValueDefinition>create());
}
Multimap<String, SpringValueDefinition> springValueDefinitions = beanName2SpringValueDefinitions.get(beanRegistry);
String[] beanNames = beanRegistry.getBeanDefinitionNames();
for (String beanName : beanNames) {
BeanDefinition beanDefinition = beanRegistry.getBeanDefinition(beanName);
MutablePropertyValues mutablePropertyValues = beanDefinition.getPropertyValues();
List<PropertyValue> propertyValues = mutablePropertyValues.getPropertyValueList();
for (PropertyValue propertyValue : propertyValues) {
Object value = propertyValue.getValue();
if (!(value instanceof TypedStringValue)) {
continue;
}
String placeholder = ((TypedStringValue) value).getValue();
Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeholder);
if (keys.isEmpty()) {
continue;
}
for (String key : keys) {
springValueDefinitions.put(beanName, new SpringValueDefinition(key, placeholder, propertyValue.getName()));
}
}
}
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.spring.property;
import com.ctrip.framework.apollo.spring.util.SpringInjector;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.TypedStringValue;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import com.ctrip.framework.apollo.build.ApolloInjector;
import com.ctrip.framework.apollo.util.ConfigUtil;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
/**
* To process xml config placeholders, e.g.
*
* <pre>
* <bean class="com.ctrip.framework.apollo.demo.spring.xmlConfigDemo.bean.XmlBean">
* <property name="timeout" value="${timeout:200}"/>
* <property name="batch" value="${batch:100}"/>
* </bean>
* </pre>
*/
public class SpringValueDefinitionProcessor implements BeanDefinitionRegistryPostProcessor {
private static final Map<BeanDefinitionRegistry, Multimap<String, SpringValueDefinition>> beanName2SpringValueDefinitions =
Maps.newConcurrentMap();
private static final Set<BeanDefinitionRegistry> PROPERTY_VALUES_PROCESSED_BEAN_FACTORIES = Sets.newConcurrentHashSet();
private final ConfigUtil configUtil;
private final PlaceholderHelper placeholderHelper;
public SpringValueDefinitionProcessor() {
configUtil = ApolloInjector.getInstance(ConfigUtil.class);
placeholderHelper = SpringInjector.getInstance(PlaceholderHelper.class);
}
@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
if (configUtil.isAutoUpdateInjectedSpringPropertiesEnabled()) {
processPropertyValues(registry);
}
}
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
}
public static Multimap<String, SpringValueDefinition> getBeanName2SpringValueDefinitions(BeanDefinitionRegistry registry) {
Multimap<String, SpringValueDefinition> springValueDefinitions = beanName2SpringValueDefinitions.get(registry);
if (springValueDefinitions == null) {
springValueDefinitions = LinkedListMultimap.create();
}
return springValueDefinitions;
}
private void processPropertyValues(BeanDefinitionRegistry beanRegistry) {
if (!PROPERTY_VALUES_PROCESSED_BEAN_FACTORIES.add(beanRegistry)) {
// already initialized
return;
}
if (!beanName2SpringValueDefinitions.containsKey(beanRegistry)) {
beanName2SpringValueDefinitions.put(beanRegistry, LinkedListMultimap.<String, SpringValueDefinition>create());
}
Multimap<String, SpringValueDefinition> springValueDefinitions = beanName2SpringValueDefinitions.get(beanRegistry);
String[] beanNames = beanRegistry.getBeanDefinitionNames();
for (String beanName : beanNames) {
BeanDefinition beanDefinition = beanRegistry.getBeanDefinition(beanName);
MutablePropertyValues mutablePropertyValues = beanDefinition.getPropertyValues();
List<PropertyValue> propertyValues = mutablePropertyValues.getPropertyValueList();
for (PropertyValue propertyValue : propertyValues) {
Object value = propertyValue.getValue();
if (!(value instanceof TypedStringValue)) {
continue;
}
String placeholder = ((TypedStringValue) value).getValue();
Set<String> keys = placeholderHelper.extractPlaceholderKeys(placeholder);
if (keys.isEmpty()) {
continue;
}
for (String key : keys) {
springValueDefinitions.put(beanName, new SpringValueDefinition(key, placeholder, propertyValue.getName()));
}
}
}
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/model/NamespaceGrayDelReleaseModel.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.entity.model;
import java.util.Set;
public class NamespaceGrayDelReleaseModel extends NamespaceReleaseModel implements Verifiable {
private Set<String> grayDelKeys;
public Set<String> getGrayDelKeys() {
return grayDelKeys;
}
public void setGrayDelKeys(Set<String> grayDelKeys) {
this.grayDelKeys = grayDelKeys;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.entity.model;
import java.util.Set;
public class NamespaceGrayDelReleaseModel extends NamespaceReleaseModel implements Verifiable {
private Set<String> grayDelKeys;
public Set<String> getGrayDelKeys() {
return grayDelKeys;
}
public void setGrayDelKeys(Set<String> grayDelKeys) {
this.grayDelKeys = grayDelKeys;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthFilterConfiguration.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.spi.configuration;
import com.ctrip.framework.apollo.openapi.filter.ConsumerAuthenticationFilter;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuditUtil;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AuthFilterConfiguration {
@Bean
public FilterRegistrationBean openApiAuthenticationFilter(ConsumerAuthUtil consumerAuthUtil,
ConsumerAuditUtil consumerAuditUtil) {
FilterRegistrationBean openApiFilter = new FilterRegistrationBean();
openApiFilter.setFilter(new ConsumerAuthenticationFilter(consumerAuthUtil, consumerAuditUtil));
openApiFilter.addUrlPatterns("/openapi/*");
return openApiFilter;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal.spi.configuration;
import com.ctrip.framework.apollo.openapi.filter.ConsumerAuthenticationFilter;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuditUtil;
import com.ctrip.framework.apollo.openapi.util.ConsumerAuthUtil;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AuthFilterConfiguration {
@Bean
public FilterRegistrationBean openApiAuthenticationFilter(ConsumerAuthUtil consumerAuthUtil,
ConsumerAuditUtil consumerAuditUtil) {
FilterRegistrationBean openApiFilter = new FilterRegistrationBean();
openApiFilter.setFilter(new ConsumerAuthenticationFilter(consumerAuthUtil, consumerAuditUtil));
openApiFilter.addUrlPatterns("/openapi/*");
return openApiFilter;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-client/src/test/java/com/ctrip/framework/apollo/internals/JsonConfigFileTest.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.internals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.enums.ConfigSourceType;
import java.util.Properties;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RunWith(MockitoJUnitRunner.class)
public class JsonConfigFileTest {
private String someNamespace;
@Mock
private ConfigRepository configRepository;
private ConfigSourceType someSourceType;
@Before
public void setUp() throws Exception {
someNamespace = "someName";
}
@Test
public void testWhenHasContent() throws Exception {
Properties someProperties = new Properties();
String key = ConfigConsts.CONFIG_FILE_CONTENT_KEY;
String someValue = "someValue";
someProperties.setProperty(key, someValue);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getConfig()).thenReturn(someProperties);
when(configRepository.getSourceType()).thenReturn(someSourceType);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertEquals(ConfigFileFormat.JSON, configFile.getConfigFileFormat());
assertEquals(someNamespace, configFile.getNamespace());
assertTrue(configFile.hasContent());
assertEquals(someValue, configFile.getContent());
assertEquals(someSourceType, configFile.getSourceType());
}
@Test
public void testWhenHasNoContent() throws Exception {
when(configRepository.getConfig()).thenReturn(null);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertFalse(configFile.hasContent());
assertNull(configFile.getContent());
}
@Test
public void testWhenConfigRepositoryHasError() throws Exception {
when(configRepository.getConfig()).thenThrow(new RuntimeException("someError"));
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertFalse(configFile.hasContent());
assertNull(configFile.getContent());
assertEquals(ConfigSourceType.NONE, configFile.getSourceType());
}
@Test
public void testOnRepositoryChange() throws Exception {
Properties someProperties = new Properties();
String key = ConfigConsts.CONFIG_FILE_CONTENT_KEY;
String someValue = "someValue";
String anotherValue = "anotherValue";
someProperties.setProperty(key, someValue);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getConfig()).thenReturn(someProperties);
when(configRepository.getSourceType()).thenReturn(someSourceType);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertEquals(someValue, configFile.getContent());
assertEquals(someSourceType, configFile.getSourceType());
Properties anotherProperties = new Properties();
anotherProperties.setProperty(key, anotherValue);
ConfigSourceType anotherSourceType = ConfigSourceType.REMOTE;
when(configRepository.getSourceType()).thenReturn(anotherSourceType);
configFile.onRepositoryChange(someNamespace, anotherProperties);
assertEquals(anotherValue, configFile.getContent());
assertEquals(anotherSourceType, configFile.getSourceType());
}
@Test
public void testWhenConfigRepositoryHasErrorAndThenRecovered() throws Exception {
Properties someProperties = new Properties();
String key = ConfigConsts.CONFIG_FILE_CONTENT_KEY;
String someValue = "someValue";
someProperties.setProperty(key, someValue);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getConfig()).thenThrow(new RuntimeException("someError"));
when(configRepository.getSourceType()).thenReturn(someSourceType);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertFalse(configFile.hasContent());
assertNull(configFile.getContent());
assertEquals(ConfigSourceType.NONE, configFile.getSourceType());
configFile.onRepositoryChange(someNamespace, someProperties);
assertTrue(configFile.hasContent());
assertEquals(someValue, configFile.getContent());
assertEquals(someSourceType, configFile.getSourceType());
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.internals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.enums.ConfigSourceType;
import java.util.Properties;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@RunWith(MockitoJUnitRunner.class)
public class JsonConfigFileTest {
private String someNamespace;
@Mock
private ConfigRepository configRepository;
private ConfigSourceType someSourceType;
@Before
public void setUp() throws Exception {
someNamespace = "someName";
}
@Test
public void testWhenHasContent() throws Exception {
Properties someProperties = new Properties();
String key = ConfigConsts.CONFIG_FILE_CONTENT_KEY;
String someValue = "someValue";
someProperties.setProperty(key, someValue);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getConfig()).thenReturn(someProperties);
when(configRepository.getSourceType()).thenReturn(someSourceType);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertEquals(ConfigFileFormat.JSON, configFile.getConfigFileFormat());
assertEquals(someNamespace, configFile.getNamespace());
assertTrue(configFile.hasContent());
assertEquals(someValue, configFile.getContent());
assertEquals(someSourceType, configFile.getSourceType());
}
@Test
public void testWhenHasNoContent() throws Exception {
when(configRepository.getConfig()).thenReturn(null);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertFalse(configFile.hasContent());
assertNull(configFile.getContent());
}
@Test
public void testWhenConfigRepositoryHasError() throws Exception {
when(configRepository.getConfig()).thenThrow(new RuntimeException("someError"));
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertFalse(configFile.hasContent());
assertNull(configFile.getContent());
assertEquals(ConfigSourceType.NONE, configFile.getSourceType());
}
@Test
public void testOnRepositoryChange() throws Exception {
Properties someProperties = new Properties();
String key = ConfigConsts.CONFIG_FILE_CONTENT_KEY;
String someValue = "someValue";
String anotherValue = "anotherValue";
someProperties.setProperty(key, someValue);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getConfig()).thenReturn(someProperties);
when(configRepository.getSourceType()).thenReturn(someSourceType);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertEquals(someValue, configFile.getContent());
assertEquals(someSourceType, configFile.getSourceType());
Properties anotherProperties = new Properties();
anotherProperties.setProperty(key, anotherValue);
ConfigSourceType anotherSourceType = ConfigSourceType.REMOTE;
when(configRepository.getSourceType()).thenReturn(anotherSourceType);
configFile.onRepositoryChange(someNamespace, anotherProperties);
assertEquals(anotherValue, configFile.getContent());
assertEquals(anotherSourceType, configFile.getSourceType());
}
@Test
public void testWhenConfigRepositoryHasErrorAndThenRecovered() throws Exception {
Properties someProperties = new Properties();
String key = ConfigConsts.CONFIG_FILE_CONTENT_KEY;
String someValue = "someValue";
someProperties.setProperty(key, someValue);
someSourceType = ConfigSourceType.LOCAL;
when(configRepository.getConfig()).thenThrow(new RuntimeException("someError"));
when(configRepository.getSourceType()).thenReturn(someSourceType);
JsonConfigFile configFile = new JsonConfigFile(someNamespace, configRepository);
assertFalse(configFile.hasContent());
assertNull(configFile.getContent());
assertEquals(ConfigSourceType.NONE, configFile.getSourceType());
configFile.onRepositoryChange(someNamespace, someProperties);
assertTrue(configFile.hasContent());
assertEquals(someValue, configFile.getContent());
assertEquals(someSourceType, configFile.getSourceType());
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/PropertiesUtil.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.core.utils;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Properties;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class PropertiesUtil {
/**
* Transform the properties to string format
* @param properties the properties object
* @return the string containing the properties
* @throws IOException
*/
public static String toString(Properties properties) throws IOException {
StringWriter writer = new StringWriter();
properties.store(writer, null);
StringBuffer stringBuffer = writer.getBuffer();
filterPropertiesComment(stringBuffer);
return stringBuffer.toString();
}
/**
* filter out the first comment line
* @param stringBuffer the string buffer
* @return true if filtered successfully, false otherwise
*/
static boolean filterPropertiesComment(StringBuffer stringBuffer) {
//check whether has comment in the first line
if (stringBuffer.charAt(0) != '#') {
return false;
}
int commentLineIndex = stringBuffer.indexOf("\n");
if (commentLineIndex == -1) {
return false;
}
stringBuffer.delete(0, commentLineIndex + 1);
return true;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.core.utils;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Properties;
/**
* @author Jason Song(song_s@ctrip.com)
*/
public class PropertiesUtil {
/**
* Transform the properties to string format
* @param properties the properties object
* @return the string containing the properties
* @throws IOException
*/
public static String toString(Properties properties) throws IOException {
StringWriter writer = new StringWriter();
properties.store(writer, null);
StringBuffer stringBuffer = writer.getBuffer();
filterPropertiesComment(stringBuffer);
return stringBuffer.toString();
}
/**
* filter out the first comment line
* @param stringBuffer the string buffer
* @return true if filtered successfully, false otherwise
*/
static boolean filterPropertiesComment(StringBuffer stringBuffer) {
//check whether has comment in the first line
if (stringBuffer.charAt(0) != '#') {
return false;
}
int commentLineIndex = stringBuffer.indexOf("\n");
if (commentLineIndex == -1) {
return false;
}
stringBuffer.delete(0, commentLineIndex + 1);
return true;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/package-info.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* This package defines common interfaces so that each company could provide their own implementations.<br/>
* Currently we provide 2 implementations: Ctrip and Default.<br/>
* Ctrip implementation will be activated only when spring.profiles.active = ctrip.
* So if spring.profiles.active is not ctrip, the default implementation will be activated.
* You may refer com.ctrip.framework.apollo.portal.spi.configuration.AuthConfiguration when providing your own implementation.
*
* @see com.ctrip.framework.apollo.portal.spi.configuration.AuthConfiguration
*/
package com.ctrip.framework.apollo.portal.spi;
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* This package defines common interfaces so that each company could provide their own implementations.<br/>
* Currently we provide 2 implementations: Ctrip and Default.<br/>
* Ctrip implementation will be activated only when spring.profiles.active = ctrip.
* So if spring.profiles.active is not ctrip, the default implementation will be activated.
* You may refer com.ctrip.framework.apollo.portal.spi.configuration.AuthConfiguration when providing your own implementation.
*
* @see com.ctrip.framework.apollo.portal.spi.configuration.AuthConfiguration
*/
package com.ctrip.framework.apollo.portal.spi;
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalApplication.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal;
import com.ctrip.framework.apollo.common.ApolloCommonConfig;
import com.ctrip.framework.apollo.openapi.PortalOpenApiConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableAspectJAutoProxy
@Configuration
@EnableAutoConfiguration(exclude = {LdapAutoConfiguration.class})
@EnableTransactionManagement
@ComponentScan(basePackageClasses = {ApolloCommonConfig.class,
PortalApplication.class, PortalOpenApiConfig.class})
public class PortalApplication {
public static void main(String[] args) throws Exception {
SpringApplication.run(PortalApplication.class, args);
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.portal;
import com.ctrip.framework.apollo.common.ApolloCommonConfig;
import com.ctrip.framework.apollo.openapi.PortalOpenApiConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableAspectJAutoProxy
@Configuration
@EnableAutoConfiguration(exclude = {LdapAutoConfiguration.class})
@EnableTransactionManagement
@ComponentScan(basePackageClasses = {ApolloCommonConfig.class,
PortalApplication.class, PortalOpenApiConfig.class})
public class PortalApplication {
public static void main(String[] args) throws Exception {
SpringApplication.run(PortalApplication.class, args);
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/CharacterEncodingFilterConfiguration.java | /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.controller;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.CharacterEncodingFilter;
import javax.servlet.DispatcherType;
@Configuration
public class CharacterEncodingFilterConfiguration {
@Bean
public FilterRegistrationBean encodingFilter() {
FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new CharacterEncodingFilter());
bean.addInitParameter("encoding", "UTF-8");
//FIXME: https://github.com/Netflix/eureka/issues/702
// bean.addInitParameter("forceEncoding", "true");
bean.setName("encodingFilter");
bean.addUrlPatterns("/*");
bean.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.FORWARD);
return bean;
}
}
| /*
* Copyright 2021 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.controller;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.CharacterEncodingFilter;
import javax.servlet.DispatcherType;
@Configuration
public class CharacterEncodingFilterConfiguration {
@Bean
public FilterRegistrationBean encodingFilter() {
FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new CharacterEncodingFilter());
bean.addInitParameter("encoding", "UTF-8");
//FIXME: https://github.com/Netflix/eureka/issues/702
// bean.addInitParameter("forceEncoding", "true");
bean.setName("encodingFilter");
bean.addUrlPatterns("/*");
bean.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.FORWARD);
return bean;
}
}
| -1 |
apolloconfig/apollo | 3,699 | Remove redundant invoke of trySyncFromUpstream | Fix #3698 | Technoboy- | 2021-05-21T08:58:57Z | 2021-05-21T09:38:14Z | 0fb159f5f28fa379351e978c7aba0ec3a00aa4e9 | f41a73b92d19383bbb542c51b0f6d062e9e80e3b | Remove redundant invoke of trySyncFromUpstream. Fix #3698 | ./doc/images/gray-release/select-gray-release-ip.png | PNG
IHDR M vOj IDATxygW}3:څ]HBha5
8`!TbNUJyST$*10f1 $о4,<:÷ӯ{G|N}={Ν_!!!!!!!!!p<k
@@@@@@@@@tk!B B B B B`&yss8#!0 o #!!!!!R fgg֭͛[[^F_* LNN
6쑽N b_.fffړO>EC9oMR!!ZAk۶mkGyd@7$!!!!!{>l8$bLO4˾~=CxT9zwYmriCm Ȱ=M7@@@,F@߆֬Yo1X@{a[li7n| )%j>V9[d^_[~w5~c߯;z7@R}C^7&81o\1h_q-발K|MOO2y43<ӇDڴiS;E4yC^/1a.eu~~ǺWuW9F-1å^2Nމ!!!C}ʡ_C B {cRY}td(&$
i巿۷bh<+፟y fR8+|*6/<>W<?OO=T28<*\!\uLecw-iԲw.࣏>څM&C B B B B B B B$>
f*e]jwG[4L{o{l_~|n.ڵky V&o.*"<* 2t;ܨ_GuT;s?֭[ׇXSeO:flSzK諰/b|w)N?ᦛneT7|O=ԝ襤0!!!!!!!!p#bO<чoʱ<ec=vQ!5_ SC1O]PP/&\W_}uӈko>W\1/:>,rO($eb'A.k0?ҩ43Bb]:r)z,Ak0괫!!!!!!!2tAqLF!l/Ys>C4Ë#,E3UYz*u
[~+ܞZ˃e![ێ;V~NMeοn{kQب{Gt\8tF~}poY,r8XOcyGs=~ꉥ4UXUe_UZSdz>x:XεsJMC` Y\381{wqxC+nWmnn}aF62lξʺ/x<^m[UB=qxwSh:uŭ0]<ꍁx^,Fo<>Lu\B7>@[ 'NzNkWWWU}xĵH}k_=kww:_URƅʔ!!!!nj9cD~5=QoS~cNUqkF폮o&n3fW]q[&huŭh=v哷}ƍw:gŹʸ<,CC` r?yw]Ic#]<eVW{o-O\
xj|4K.F볯u0žG~'Bu
/j~n b`p:p'`0sE OXI8:7n,nK9$RsR*uk9yUqIkVu%IsӰTp\X]wuNu=?>+λLTEkG8esNamO]*u-wN?n+qR\xI'E@@@@CA^eoc^e}6U]*KWNO|?Bӱ]w^XA߲aRӫU6bMReVvif)Bn!_DyKCCGU0Kٖϰ~ʠ~[n;QM{鯲s~Fׅ~AT;+C '
vO9Px碋.7|s?CP:Wwz#ֆ/캇g{xN>2m#/IsaD y9\"0j@s\3Bp#ˢk"e-3p3,rBױ'1v#Q :sx<)ǨSq+Fy)o-/Ŝ?n,])HWC#
hr t4h4}G)Cq\:9!!!~P%ŇGB>>O߱\:qF_3/[oG#cX'o߫c}{ٗ~V|k:/eP&V')
ReO@K2zq0>|1;NzY~vQgT9˕EBӟUE\}nιP%ijbvC ^L^yQZTFM>,=ޭ-V6PVm6QW~T[쾶hc&{H=k2.^mb~hw|Xqۋ9.J:baeEsAwųGFW7?7o۽"v'O縇KqB
XnttV}v2zXhp#*'=cems:iAP-.ø;./ysʡQY(=a㜸0=wf4ݪbɬi.➌kɯ8KG\*1_\@@@O<}gV~o>^fP*>}R}_xs9?EPҗ~~myTMr_Vȣu\8/ʯ+>z QRV:KշG<SX+/|C'0t{~~86fx1 GTÎO|_Y29<^P\}<εHOܨo\Sy
MGTډ{mtm)MC;c~kprm&jO͔}Chއ-V$[Њ_/tW;*8=E=KmӳJw4JmOed3r qѕ8J`s(nWzXJNZP<&r<^`t%D߃W9/ǡJøtLWGidl9|h8*:,::hU0voui7h6,]8d1FC B B B`oяG'gX}dızc@UqS*U~8DŽ'K9a_ꥋɳҴV?,˻lt7jVe]b[n]Fj_:Sf+ο~'0·8ʍw}_<Uh'Lxa 5߮8 tUt8DW~.6@=6=*},8x77W8{( =~ԶDݴ_mvJ眶SZg8Zm<cj%Ҏҫs֏n.ru<b \9'yHeD,d*.܆փ#6rb}iÑ~%I|^X*OuS9!Ep11pnv:G/&e_]ks΅qΆq_eU_6t\ðe/cC7.LanaKø: j:Ņ@@@ ?b
/9~?T}qևN˥//p㶽dFח.hKe0l6?qKK+*O@鿎:a1Uq2Rǽømvn~<'-V?uX~^u`{
oXvVD/~!g!
2rkm6W[c)Q϶4M;^t\sM&u_LY 3ښ*}"`IW&h:itMFyjGWַ!yЅve|ʢ39dWzjPֻ%Sm smLx8<4]Aq8'diT:@[\[q7q.8uP*OS^}
=Zi*X9b9E+}<E%}20p[XFs
TmycQ吟ZFE>Zy
7-?צsWz!!!/ܾ0.EG?}PxC~~7GRGLXQKdžyn A/[l57x^qK_~#n_ЏeR3K50Nm/_Z^9erwt]i:+}W-uZܵ+n9\οaxU\avB@!0WewֽdMljK
?6ؽ}ߴSmni,em[Bzi[mu@jw:k״9ZόjoմE yipiL Kds
.EpV~ۄz:6ꄹ{C's;wKS`U*CA!Ccǟf۱*
l;Q<gR:dSpq2,>iX;EmTR^+<Wջʢ8U::U qyc;<'AT+.괫4#]uί08]{ ƺW^-'Q7S~Ǿ@gXzMI#1.u@@@@AjC//(>+^]xQ;KűևNҿ,aLFþru|fN
o^*z)E\+ЯpUzu\^yK˯7onJSWaZկ~Tt0
AT3"ԋx#~ˑX^z_SUmZ!(jtƏpV
U_*}Kܒ>O\vFĵv)v;eVbwnerL=QxRٳOx<< 1N'/\o_rgqUWDzpA406e_,qic Щ`L8 lAvLCb!7[aΉ\N'm){i\#|ֹ_K+R?Qkeaac+"}|07)R
eTY@@@R !g1J,Mc_?_
eŨ/~?Շ,
5K|~tSI?/}/X\uihB^ē^lW ~/q/FƌsW-w[WxʻX [c[8eQ?6on79i_\ zKaڶ_D8PԵ[EK86k#P]zPۺwfg9h L%2}mO<UV+K9<kL
aJ2\Rw?gʹ`!.4lOǝC,$}m_ω~_M~|s<i3`ˍ+ߋ^"=< |