Skip to content

Commit ffb21c0

Browse files
Merge pull request #9755 from harness/IMPENG-492
Adding KB article on **How to extract Harness Feature Flags**
2 parents 6dd335d + 76e0fff commit ffb21c0

8 files changed

+119
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# How to extract Harness Feature Flags
2+
3+
## Feature Flags on the Harness Platform
4+
5+
The Harness Platform is continuously evolving, with the product team regularly releasing new features and critical fixes. However, not all features and fixes are immediately available to all customers, as they must undergo thorough testing and validation.
6+
7+
Feature Flags allow specific features of the Harness Platform to be enabled or disabled for individual customer accounts. These flags are managed by the Harness Support team upon request. Many customers frequently inquire about the feature flags enabled for their accounts. This documentation provides guidance on how to retrieve that information.
8+
9+
### Tools Needed:
10+
11+
* chrome / safari browser
12+
* curl
13+
* jq
14+
* gitbash (if Windows)
15+
16+
### Instructions:
17+
18+
*Note*: These instructions have been tested on a MacBook and may vary slightly for Windows machines. Please refer to the respective browser's help documentation for specific guidance.
19+
20+
1. Navigate to the Harness on the browser
21+
22+
2. On the browser, open up Developer Tools
23+
24+
- **Chrome**: View → Developer → Developer Tools
25+
26+
![Image](../static/ff-chrome-developer-tools.png)
27+
28+
- **Safari**: Develop → Show Javascript Console
29+
30+
![Image](../static/ff-safari-dev-tools.png)
31+
32+
3. Navigate to the Network tab
33+
34+
4. Search for **“evaluations“**
35+
36+
5. Refresh the browser.
37+
38+
6. Make sure you select **“evaluations”** in Name
39+
40+
7. Go to the Response (chrome) or Preview (safari) tab and see the entire payload with FF are enabled and disabled
41+
42+
- value: true = On/Enabled
43+
44+
- value: false = Off/Disabled
45+
46+
- **Chrome**:
47+
48+
![Image](../static/ff-chrome-network.png)
49+
50+
- **Safari**:
51+
52+
![Image](../static/ff-safari-network-console.png)
53+
54+
8. From the Response / Preview Tab you can search (CTRL+F) the entire payload to find any specific flags
55+
56+
![Image](../static/ff-list-search.jpg)
57+
58+
9. To run same command from command line (cURL), right click on the Name:evaluations?cluster=1 (chrome) / Name:evaluations (safari) then choose Copy=>Copy as cURL (chrome) / Copy as cURL (safari) option. You will have a full cURL command.
59+
60+
- **Chrome Screenshot**:
61+
62+
![Image](../static/get-ff-curl.png)
63+
64+
- **Safari Screenshot**:
65+
66+
![Image](../static/ff-safari-copy-curl.png)
67+
68+
10. Append the command you got from step 9 with “-o ff.json” and run in the terminal as below. *Note: Please DO NOT copy and run below examplec code; it will not work!*
69+
```
70+
71+
curl 'https://proxy-prod.ff.harness.io/client/env/27e2d176-95b8-49b3-a76d-698e3056bcd7/target/1YXEnD4uTqqnkRbbeT3QAA/evaluations?cluster=1' \
72+
73+
  -H 'accept: */*' \
74+
75+
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
76+
77+
  -H 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlLZXkiOiJhdXRoLWtleS1mOWU4ODliZjMzNzNiNTEyN2*************************************************************************************************************************************************************************************************************************************************************************************b1TGiH4EnuuWDq_l9O0isda4' \
78+
79+
  -H 'harness-accountid: undefined' \
80+
81+
  -H 'harness-environmentid: undefined' \
82+
83+
  -H 'harness-sdk-info: Javascript 1.26.1 Client' \
84+
85+
  -H 'harness-target: eyJpZGVudGlmaWVyIjoiMVlYRW5ENHVUcXFua1JiYmVUM1FBQSIsIm5hbWUiOiIxWVhFbkQ0dVRxcW5rUmJiZVQzUUFBIn0=' \
86+
87+
  -H 'origin: https://app.harness.io' \
88+
89+
  -H 'priority: u=1, i' \
90+
91+
  -H 'sec-ch-ua: "Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"' \
92+
93+
  -H 'sec-ch-ua-mobile: ?0' \
94+
95+
  -H 'sec-ch-ua-platform: "macOS"' \
96+
97+
  -H 'sec-fetch-dest: empty' \
98+
99+
  -H 'sec-fetch-mode: cors' \
100+
101+
  -H 'sec-fetch-site: same-site' \
102+
103+
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36’ \
104+
105+
-o ff.json
106+
```
107+
The above command will write all the json output containing all the feature flags into a file **ff.json**
108+
109+
11. Now run below commands to get the relevant list of FFs in shell terminal
110+
111+
- Feature Flags Enabled
112+
```
113+
jq  --raw-output 'map_values(select(.value == "true"))| .[]|[.flag] | @csv' ff.json | sort -u
114+
```
115+
116+
- Feature Flags NOT Enabled
117+
```
118+
jq  --raw-output 'map_values(select(.value == "false"))| .[]|[.flag] | @csv' ff.json | sort -u
119+
```
Loading
193 KB
Loading

kb/platform/static/ff-list-search.jpg

95.4 KB
Loading
229 KB
Loading
483 KB
Loading
Loading

kb/platform/static/get-ff-curl.png

401 KB
Loading

0 commit comments

Comments
 (0)