Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Nimbus-SDK-119 Get Nimbus server endpoint at build time. #16682

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

jhugman
Copy link
Contributor

@jhugman jhugman commented Nov 20, 2020

This PR builds on AC##9024, and implements setting the Nimbus endpoints from a secret set at build time.

For production use, this requires a secret named nimbus_url to be put into CI.

Note: Nimbus is currently behind a feature flag.

If developers wish to use a Nimbus server for local development, you can set the url by adding an entry into local.properties, e.g.:

nimbus.remote-settings.url=https://settings.stage.moz4ws.net

Without setting server, Nimbus will be able to function, except no experimental definitions will be fetched, and features under experiment will be configured as if not enrolled in the experiment.

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@jhugman jhugman requested review from a team as code owners November 20, 2020 14:24
@mergify
Copy link
Contributor

mergify bot commented Nov 20, 2020

This pull request has conflicts when rebasing. Could you fix it @jhugman? 🙏

@pocmo
Copy link
Contributor

pocmo commented Nov 20, 2020

FIY: We just landed the AC update on master (with server=null to work around the breaking API change)

@gabrielluong gabrielluong self-assigned this Nov 20, 2020
@gabrielluong gabrielluong added the pr:approved PR that has been approved label Nov 20, 2020
@jhugman jhugman force-pushed the nimbus-sdk-119-derive-server-url-from-build branch from 73392ae to 5316834 Compare November 20, 2020 16:46
@codecov-io
Copy link

codecov-io commented Nov 20, 2020

Codecov Report

Merging #16682 (590db8b) into master (c465521) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #16682      +/-   ##
============================================
- Coverage     30.26%   30.25%   -0.01%     
  Complexity     1231     1231              
============================================
  Files           455      455              
  Lines         18654    18658       +4     
  Branches       2577     2578       +1     
============================================
  Hits           5645     5645              
- Misses        12562    12566       +4     
  Partials        447      447              
Impacted Files Coverage Δ Complexity Δ
...ain/java/org/mozilla/fenix/components/Analytics.kt 52.45% <0.00%> (-3.69%) 1.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c465521...590db8b. Read the comment docs.

@jhugman
Copy link
Contributor Author

jhugman commented Nov 20, 2020

[task 2020-11-20T16:51:44.876Z] + taskcluster/scripts/get-secret.py -s project/mobile/fenix/nightly-simulation -k nimbus_url -f .nimbus
[task 2020-11-20T16:51:45.151Z] Outputting secret to: /builds/worker/checkouts/src/.nimbus
[task 2020-11-20T16:51:45.151Z] Traceback (most recent call last):
[task 2020-11-20T16:51:45.151Z]   File "taskcluster/scripts/get-secret.py", line 69, in <module>
[task 2020-11-20T16:51:45.151Z]     main()
[task 2020-11-20T16:51:45.151Z]   File "taskcluster/scripts/get-secret.py", line 65, in main
[task 2020-11-20T16:51:45.151Z]     write_secret_to_file(result.path, secret, result.key, result.decode, result.json, result.append, result.prefix)
[task 2020-11-20T16:51:45.151Z]   File "taskcluster/scripts/get-secret.py", line 27, in write_secret_to_file
[task 2020-11-20T16:51:45.151Z]     value = data['secret'][key]
[task 2020-11-20T16:51:45.151Z] KeyError: 'nimbus_url'

This looks like it requires a secret URL put on taskcluster. Who would be the right person to convey this secret to to get this on to taskcluster? @pocmo ? @amedyne ? @st3fan ?

@pocmo
Copy link
Contributor

pocmo commented Nov 20, 2020

@JohanLorenzo or @MihaiTabara can help with that, I think. What URL do we need to use (or is that actually secret?)? I may have access too, but I am not sure if I remember the right paths for all build variants on https://firefox-ci-tc.services.mozilla.com/secrets

This PR builds on [AC##9024][1], and implements setting the Nimbus endpoints from [a secret set at build time][2].

For production use, this requires a secret named `nimbus_url` to be put into CI.

Note: Nimbus is currently behind a feature flag.

If developers wish to use a Nimbus server for local development, you can set the url by adding an entry into local.properties, e.g.:

```
nimbus.remote-settings.url=https://settings.stage.moz4ws.net
```

Without setting server, Nimbus will be able to function, except no experimental definitions will be fetched, and features under experiment will be configured as if not enrolled in the experiment.

[1]: mozilla-mobile/android-components#9024
[2]: https://groups.google.com/a/mozilla.com/g/android-components-team/c/lAGVKQy8aiA/m/rY3uGAwhBAAJ
@jhugman jhugman force-pushed the nimbus-sdk-119-derive-server-url-from-build branch from 41d80c8 to 590db8b Compare December 3, 2020 15:57
@jhugman jhugman merged commit ea9f692 into master Dec 3, 2020
@bors bors bot deleted the nimbus-sdk-119-derive-server-url-from-build branch December 3, 2020 16:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:approved PR that has been approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants