Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8b953e2
Update TODO list
dmose Mar 23, 2025
21ecd44
Add basic instructions for copilot case sensitivity.
dmose Mar 23, 2025
6a0112e
Refactor page.tsx to call fetchData and pass params
dmose Mar 23, 2025
b3b9a94
Fixup Android calling of Dashboard component.
dmose Mar 23, 2025
9e18ede
Made localData optional to Dashboard component
dmose Mar 23, 2025
e31c39e
Make the file case instructions clearer
dmose Mar 23, 2025
6f199bb
Fixup dashboard test
dmose Mar 23, 2025
487c0c7
Move platform to a union type
dmose Mar 23, 2025
c5e2a1e
Refactor fetchData to its own file
dmose Mar 23, 2025
0340475
Renamed fetchData.tsx to fetchData.ts
dmose Mar 23, 2025
ebe78b0
Export compareDatesFn to fix the app
dmose Mar 23, 2025
dccc2a0
Remove obsolete fetchData.tsx
dmose Mar 23, 2025
a85e012
Move getASRouterLocalMessageIntoFromFile to fetchData.ts
dmose Mar 23, 2025
deef435
Move getASRouterLocalColumnFromJSON to fetchData.ts
dmose Mar 23, 2025
4ed15b0
Remove extra copy of getMsgExpRecipeCollection from dashboard.tsx
dmose Mar 23, 2025
05e7baa
Remove dead code
dmose Mar 23, 2025
f95527b
Move appendFxMSTelemetryData to fetchData.ts
dmose Mar 23, 2025
1887313
Move functions to fetchData and clean up
dmose Mar 23, 2025
a8c8fbb
Appease prettier
dmose Mar 23, 2025
92605cc
Update comment about fetchData file home
dmose Mar 23, 2025
84d2601
Formatting tweaks
dmose Mar 23, 2025
db42cee
Update TODO list
dmose Mar 23, 2025
31dc009
Flesh out Android standup plan
dmose Mar 23, 2025
20b3e7a
Minor TODO update
dmose Mar 24, 2025
a9002b1
Add WIP MOBILE-EPICS list
dmose Mar 24, 2025
43a56a8
Update mobile epics
dmose Mar 24, 2025
2b3b3c9
Appease prettier
dmose Mar 24, 2025
3c89b3b
Create platformInfo object
dmose Mar 25, 2025
9465ea5
Added a test to check for correct URL construction
dmose Mar 26, 2025
6847744
Move experiments path component to a more sensible env var
dmose Mar 26, 2025
73566a4
Standarize platform typing to the nimbus platform slug strings
dmose Mar 26, 2025
e248a93
Fix platformDisplayName use
dmose Mar 26, 2025
5ad4470
Remove some env vars for modularity
dmose Mar 27, 2025
06c3907
Clean up PR to review
sarahhjchung Apr 15, 2025
49ee43b
Add more comments and update isCompleted boolean
sarahhjchung Apr 15, 2025
dda789c
Update README, CONTRIBUTING, and CHANGELOG
sarahhjchung Apr 15, 2025
4774e72
Make fetchData for mobile default to live
sarahhjchung Apr 15, 2025
a460216
Update CHANGELOG
sarahhjchung Apr 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@

# Base URL for the experimenter API (defaults to the production instance)
#
EXPERIMENTER_API_PREFIX="https://experimenter.services.mozilla.com/api/v7/"

# API calls with parameters to fetch experiments we want to display.
# https://htmlpreview.github.io/?https://github.com/mozilla/experimenter/blob/main/docs/experimenter/swagger-ui.html has more info.
#
# Live experiments
EXPERIMENTER_API_CALL_LIVE="experiments/?status=Live&application=firefox-desktop"

# Completed experiments
EXPERIMENTER_API_CALL_COMPLETED="experiments/?status=Complete&application=firefox-desktop"
EXPERIMENTER_API_PREFIX="https://experimenter.services.mozilla.com/api/v7/experiments/"

# Looker configurables
IS_LOOKER_ENABLED=false
Expand Down
5 changes: 3 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copy this to .env.local to set local variables

# Preview
# EXPERIMENTER_API_CALL="experiments/?status=Preview&application=firefox-desktop"
# Base URL for the experimenter API (defaults to the production instance)
#
EXPERIMENTER_API_PREFIX="https://experimenter.services.mozilla.com/api/v7/experiments/"

# Disable Auth0 for dev && preview environments
IS_AUTH_ENABLED='false'
Expand Down
25 changes: 25 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# GitHub Copilot Instructions

## Case-Sensitive Filesystem

Some of our development happens on a case-sensitive filesystem. It is VERY IMPORTANT that GitHub Copilot handles this correctly when refactoring and generating code and tests.

### Guidelines

1. **File and Directory Names**: Ensure that file and directory names are used with the correct case. For example, `MyFile.ts` and `myfile.ts` are different files on a case-sensitive filesystem.
2. **Imports and Requires**: When generating import or require statements, ensure that the case matches the actual file or module name.
3. **Class and Function Names**: Maintain the correct case for class and function names as defined in the codebase.
4. **Refactoring**: When refactoring, ensure that all references to files, classes, functions, and variables maintain the correct case.

### Specific Instructions for Component Files

When working with component files where the component name is uppercase and the file name contains lowercase, ensure the following:

1. **Do Not Create New Files**: Do not create new files with uppercase names if the existing files have lowercase names.
2. **Correct File Names**: Use the existing files with the correct case.
3. **Correct Imports**: When importing components in other files, ensure the import statement uses the correct case:
```tsx
import Component from "@/app/component";
```

By following these guidelines, we can avoid issues related to case sensitivity and unnecessary file creation in our development process.
25 changes: 25 additions & 0 deletions .github/copilot-test-generation.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that this file and copilot-instructions.md have the same contents?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the commit 374cd7a when these docs were added, they look to be intentionally the same. So I'll leave them as is and confirm with Dan!

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# GitHub Copilot Instructions

## Case-Sensitive Filesystem

Some of our development happens on a case-sensitive filesystem. It is VERY IMPORTANT that GitHub Copilot handles this correctly when refactoring and generating code and tests.

### Guidelines

1. **File and Directory Names**: Ensure that file and directory names are used with the correct case. For example, `MyFile.ts` and `myfile.ts` are different files on a case-sensitive filesystem.
2. **Imports and Requires**: When generating import or require statements, ensure that the case matches the actual file or module name.
3. **Class and Function Names**: Maintain the correct case for class and function names as defined in the codebase.
4. **Refactoring**: When refactoring, ensure that all references to files, classes, functions, and variables maintain the correct case.

### Specific Instructions for Component Files

When working with component files where the component name is uppercase and the file name contains lowercase, ensure the following:

1. **Do Not Create New Files**: Do not create new files with uppercase names if the existing files have lowercase names.
2. **Correct File Names**: Use the existing files with the correct case.
3. **Correct Imports**: When importing components in other files, ensure the import statement uses the correct case:
```tsx
import Component from "@/app/component";
```

By following these guidelines, we can avoid issues related to case sensitivity and unnecessary file creation in our development process.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Tueday, April 15th, 2025

### Updated

- Updated the environment variables to use an `EXPERIMENTER_API_PREFIX`. Instead of having separate environment variables for live and completed experiments, we are now using this prefix and adding on required parameters in the code when necessary.

## Friday, April 11th, 2025

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ practices solidify.

`cp .env.sample .env.local`

1. Modify variables in .env.local, e.g. uncommenting the `EXPERIMENTER_API_CALL`
line will switch from the default of live experiments to preview experiments
1. Modify variables in .env.local
1. The `EXPERIMENTER_API_PREFIX` environment variable is the base URL for the experimenter API and it defaults to the production instance. Paramaters like `status` and `application` are added to this base URL in the code to specify live/completed status and different platforms (ie. fenix, ios. firefox-desktop).

## Running the development server

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ A bunch of the code, ideas, and links come from the OMC team's work week Hackath

`cp .env.sample .env.local`

1. Modify variables in .env.local, e.g. uncommenting the `EXPERIMENTER_API_CALL`
line will switch from the default of live experiments to preview experiments
1. Modify variables in .env.local
1. The `EXPERIMENTER_API_PREFIX` environment variable is the base URL for the experimenter API and it defaults to the production instance. Paramaters like `status` and `application` are added to this base URL in the code to specify live/completed status and different platforms (ie. fenix, ios. firefox-desktop).

## Running the development server

Expand Down
10 changes: 9 additions & 1 deletion __tests__/app/dashboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ global.fetch = jest.fn(() =>
}),
) as jest.Mock;

const mockFetchData = {
localData: [],
experimentAndBranchInfo: [],
totalExperiments: 0,
msgRolloutInfo: [],
totalRolloutExperiments: 0,
};

describe.skip("Dashboard", () => {
it("all timeline pill ids exist in the Dashboard component in /", async () => {
const dashboard = await render(await (<Dashboard />));
const dashboard = await render(await (<Dashboard {...mockFetchData} />));

const firefox = dashboard.getByTestId("firefox");
const experiments = dashboard.getByTestId("live_experiments");
Expand Down
26 changes: 26 additions & 0 deletions __tests__/lib/nimbusRecipeCollection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { NimbusRecipe } from "@/lib/nimbusRecipe";
import { NimbusRecipeCollection } from "@/lib/nimbusRecipeCollection";
import { ExperimentFakes } from "@/__tests__/ExperimentFakes.mjs";
import { RecipeInfo } from "@/app/columns";
import { Platform } from "@/lib/types";

const platform: Platform = "firefox-desktop";

const fakeFetchData = [ExperimentFakes.recipe()];
global.fetch = jest.fn(() =>
Expand All @@ -27,6 +30,29 @@ describe("NimbusRecipeCollection", () => {

expect(recipes).toEqual([new NimbusRecipe(fakeFetchData[0])]);
});

it("constructs the correct URL for live experiments", async () => {
const nimbusRecipeCollection = new NimbusRecipeCollection(
false,
platform,
); //XXX YYY
await nimbusRecipeCollection.fetchRecipes();

expect(global.fetch).toHaveBeenCalledWith(
`${process.env.EXPERIMENTER_API_PREFIX}?status=Live&application=${platform}`,
{ credentials: "omit" },
);
});

it("constructs the correct URL for completed experiments", async () => {
const nimbusRecipeCollection = new NimbusRecipeCollection(true);
await nimbusRecipeCollection.fetchRecipes();

expect(global.fetch).toHaveBeenCalledWith(
`${process.env.EXPERIMENTER_API_PREFIX}?status=Complete&application=${platform}`,
{ credentials: "omit" },
);
});
});

describe("getExperimentAndBranchInfos", () => {
Expand Down
24 changes: 22 additions & 2 deletions app/android/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
import { Dashboard } from "@/app/dashboard";
import { fetchData } from "@/app/fetchData";
import { Platform } from "@/lib/types";

export default function Page() {
return <Dashboard platform={"android"} />;
const platform: Platform = "fenix";

export default async function Page() {
const {
localData,
experimentAndBranchInfo,
totalExperiments,
msgRolloutInfo,
totalRolloutExperiments,
} = await fetchData(platform);

return (
<Dashboard
platform={platform}
experimentAndBranchInfo={experimentAndBranchInfo}
totalExperiments={totalExperiments}
msgRolloutInfo={msgRolloutInfo}
totalRolloutExperiments={totalRolloutExperiments}
/>
);
}
Loading
Loading