Commit 951af3f
authored
feat(build): add build-time secret injection for launchdarkly (#157)
* feat(build): add build-time secret injection for launchdarkly
- Add reusable workflow for AWS Secrets Manager integration
- Update Dockerfile with BuildKit secret mounts for secure injection
- Configure Angular define feature for build-time constant replacement
- Implement OpenFeature with LaunchDarkly provider
- Add feature flag service and provider with SSR support
- Update all Docker build workflows to use reusable secret workflow
- Add comprehensive documentation for build-time secrets pattern
- Support local development with fallback values for ng serve
LFXV2-750
Signed-off-by: Asitha de Silva <[email protected]>
* refactor(feature-flags): remove duplicate sdk interfaces and update docs
- Remove duplicate EvaluationContext and LaunchDarklyConfig interfaces from shared package (available from @openfeature/web-sdk)
- Update feature flags documentation to show provideAppInitializer instead of deprecated APP_INITIALIZER pattern
- Replace hardcoded LaunchDarkly client IDs with placeholders in documentation
- Add preferred_username field to User interface for feature flag targeting
- Improve type safety in feature-flag.service.ts by using User type
LFXV2-750
Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Asitha de Silva <[email protected]>
* fix(build): correct --define syntax for angular cli
- Fix Dockerfile to use --define=KEY=VALUE without -- separator
- Update documentation with verified working syntax
- Remove incorrect -- separator from all examples
- Tested build completes successfully and value is injected
The Angular CLI requires --define=KEY=VALUE format directly on yarn build
commands without the -- separator. String values must be quoted within
quotes: --define=KEY="'value'"
Verified with test build that value is properly injected into bundle.
LFXV2-750
Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Asitha de Silva <[email protected]>
* refactor(build): separate shared and ui builds to support --define
- Build shared package separately before UI to avoid TypeScript compiler errors
- Use yarn workspace commands for targeted builds
- Update Dockerfile to build @lfx-one/shared then lfx-one-ui
- Update documentation with workspace build approach
- Change --define syntax to use space (matches Angular CLI docs)
This resolves the issue where running build from root would fail because
the shared package's TypeScript compiler doesn't understand --define flags.
Building them separately allows each package to use appropriate build flags.
LFXV2-750
Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Asitha de Silva <[email protected]>
* refactor(ci): use GITHUB_ENV for secret retrieval
Remove get-launchdarkly-secrets.yml reusable workflow and implement direct
AWS Secrets Manager retrieval in each job using GITHUB_ENV. This resolves
the GitHub Actions issue where masked values cannot be used in workflow
outputs.
Changes:
- Update docker-build-main.yml to retrieve secrets directly in job
- Update docker-build-tag.yml to retrieve secrets directly in job
- Update docker-build-pr.yml to retrieve secrets directly in job
- Delete get-launchdarkly-secrets.yml reusable workflow file
- Update build-time-secrets.md documentation to reflect new approach
- LaunchDarkly client-side IDs are NOT masked (they're public values)
LFXV2-750
Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Asitha de Silva <[email protected]>
---------
Signed-off-by: Asitha de Silva <[email protected]>1 parent 8b2114e commit 951af3f
File tree
23 files changed
+2333
-36
lines changed- .github/workflows
- apps/lfx-one
- src
- app
- layouts/main-layout
- modules/dashboards/board-member
- environments
- docs
- architecture/frontend
23 files changed
+2333
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
| |||
68 | 88 | | |
69 | 89 | | |
70 | 90 | | |
| 91 | + | |
| 92 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
34 | 58 | | |
35 | 59 | | |
36 | 60 | | |
| |||
72 | 96 | | |
73 | 97 | | |
74 | 98 | | |
| 99 | + | |
| 100 | + | |
75 | 101 | | |
76 | 102 | | |
77 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
36 | 56 | | |
37 | 57 | | |
38 | 58 | | |
| |||
86 | 106 | | |
87 | 107 | | |
88 | 108 | | |
| 109 | + | |
| 110 | + | |
89 | 111 | | |
90 | 112 | | |
91 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
99 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
100 | 109 | | |
101 | 110 | | |
102 | 111 | | |
| |||
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
110 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
111 | 123 | | |
112 | 124 | | |
113 | 125 | | |
114 | 126 | | |
115 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
116 | 131 | | |
117 | 132 | | |
118 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments