Commit c726ad8
[SREP-618] feat: Add refresh command to fetch config from server (#899)
* Add /config endpoint integration with lazy loading
Implements client-side integration for the new /config API endpoint
that allows backplane-cli to fetch server-managed configuration values.
Features:
- Refresh command: 'ocm backplane config refresh' to force update server values
- Backwards compatible: Existing config files work without changes
Implementation:
- New ConfigAPIClient interface for fetching remote config
- New refresh command to manually update server-managed values
Server-managed values:
- jira-base-url
- assume-initial-arn
- prod-env-name
- jira-config-for-access-requests
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Verify the logging
Signed-off-by: Daniel Hall <danhall@redhat.com>
* Don't write empty jira values to config
Signed-off-by: Daniel Hall <danhall@redhat.com>
* Fix proxy support for config refresh command
Use backplaneapi.DefaultClientUtils.GetBackplaneClient() instead of
direct client creation to ensure proper proxy configuration and
authentication. This fixes timeout issues when running behind
corporate proxies.
Signed-off-by: Daniel Hall <danhall@redhat.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Improve code quality in mapJiraAccessRequestConfig
- Add early return to avoid wasteful allocation when config is empty
- Extract magic strings to constants (transitionStateApproved, etc.)
- Enhance documentation to clarify nil-return contract
- Reuse hasTransitions variable to avoid duplicate checks
These changes improve efficiency by preventing unnecessary struct and
map allocations in the common case where the API returns empty config.
Signed-off-by: Daniel Hall <danhall@redhat.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Fix test isolation for TestNoAutomaticConfigFetch
Set BACKPLANE_CONFIG to a non-existent path in the test to prevent
it from reading the user's actual config file. This ensures test
isolation and prevents test failures when the user's config contains
different values than the test expects.
Signed-off-by: Daniel Hall <danhall@redhat.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Signed-off-by: Daniel Hall <danhall@redhat.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent e5e2e37 commit c726ad8
File tree
13 files changed
+1263
-10
lines changed- cmd/ocm-backplane/config
- pkg
- accessrequest
- client/mocks
- cli/config
- mocks
13 files changed
+1263
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments