Migrating to OSA Proxy Go¶
This section describes how to migrate configuration from the legacy Java/Spring version of OSA Proxy to OSA Proxy Go. The legacy configuration used application.yml; the Go version uses osa-proxy.yml.
Main changes¶
| Legacy OSA Proxy | OSA Proxy Go |
|---|---|
application.yml |
osa-proxy.yml |
codescoring.host |
codescoring.url |
codescoring.proxy-manager-host |
codescoring.osa-proxy-url |
Spring Boot logging with logging.level.ru.codescoring |
logging.level: debug/info/warn/error |
| Actuator endpoints | /healthz, /metrics, /api/v3/api-docs, /api/swagger/ |
Global codescoring.work-mode |
codescoring.work-mode plus repository[*].work-mode override |
The codescoring.enable-status-line, codescoring.block-status-code, codescoring.block-on-codescoring-errors, and codescoring.remove-blocked-versions fields keep the same meaning, but must be moved to the new osa-proxy.yml structure.
New capabilities¶
- Composer and RubyGems support.
- Repository-level work mode override with
repository[*].work-mode. - Repository-level file type filtering with
repository[*].file-type-filter. - Explicit HTTP server and HTTP client configuration in
http.serverandhttp.clientinstead of Spring Boot / WebFlux properties.
npm migration example¶
Legacy configuration:
codescoring:
host: https://codescoring.example.com
token: "<token>"
work-mode: strict_wait
proxy-manager-host: https://osa-proxy.example.com
block-on-codescoring-errors: true
remove-blocked-versions: true
npm:
enabled: true
repository:
- name: internet-npm
scan-package: true
scan-manifest: true
url-encoded-config: true
registry: https://registry.npmjs.org
Configuration for OSA Proxy Go:
codescoring:
url: https://codescoring.example.com
token: "<token>"
work-mode: strict_wait
osa-proxy-url: https://osa-proxy.example.com
block-on-codescoring-errors: true
remove-blocked-versions: true
block-status-code: 403
npm:
enabled: true
repository:
- name: internet-npm
scan-package: true
scan-manifest: true
work-mode: strict_wait
url-encoded-config: true
registry: https://registry.npmjs.org
logging:
level: info
After migration, the npm client uses the same route name:
Migration checklist¶
- Create a new
osa-proxy.ymlfile. - Move the CodeScoring platform URL from
codescoring.hosttocodescoring.url. - Move the token to
codescoring.token. - Move the external proxy URL from
codescoring.proxy-manager-hosttocodescoring.osa-proxy-url. - Choose the global
codescoring.work-modeand setrepository[*].work-modefor specific repositories when needed. - Move package manager sections and check
name,registry,scan-manifest,scan-package, andurl-encoded-config. - Enable
cache.judge.enabledonly when Redis is available and verdict caching is required. - Update package manager configuration to use OSA Proxy Go URLs.
- Check
GET /healthz,GET /metrics, and one test request for each enabled repository type.
What to remove from the old configuration¶
Spring Boot parameters, JVM options, and actuator settings are not part of osa-proxy.yml. The Go version does not use /actuator/metrics or /actuator/prometheus; metrics are exposed directly at /metrics.
Страница была полезна?