Skip to content

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.server and http.client instead 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:

npm config set registry https://osa-proxy.example.com/internet-npm/
npm view lodash version

Migration checklist

  1. Create a new osa-proxy.yml file.
  2. Move the CodeScoring platform URL from codescoring.host to codescoring.url.
  3. Move the token to codescoring.token.
  4. Move the external proxy URL from codescoring.proxy-manager-host to codescoring.osa-proxy-url.
  5. Choose the global codescoring.work-mode and set repository[*].work-mode for specific repositories when needed.
  6. Move package manager sections and check name, registry, scan-manifest, scan-package, and url-encoded-config.
  7. Enable cache.judge.enabled only when Redis is available and verdict caching is required.
  8. Update package manager configuration to use OSA Proxy Go URLs.
  9. 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.

Страница была полезна?