Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added appContext in Metrics #1472

Merged
merged 12 commits into from
Jun 3, 2024
Merged

Added appContext in Metrics #1472

merged 12 commits into from
Jun 3, 2024

Conversation

RidhamShah
Copy link
Collaborator

@RidhamShah RidhamShah commented Apr 24, 2024

Completed

  • Updated Metric model to add context as an array
  • Updated Migration file
  • Update CRUD operations
  • Added a new API to get metrics only having the given context.
  • Updated stepper to show metrics belonging to the context
  • Updated test cases for the changes
  • Updated format of pre-created metrics from .env file

Remaining

  • create a way to add context in the JSON editor of metrics. ( For this part a new issue crated for UI design - ISSUE )

@RidhamShah
Copy link
Collaborator Author

RidhamShah commented Apr 24, 2024

Can we confirm about the new metrics structure of env file
@amurphy-cl @danoswaltCL

METRICS = [
     {
          metrics: [
               {
                    metric: totalTimeSeconds, 
                    datatype: 'continuous'
               },
               {
                    metric: 'workspaceCompletionStatus',
                    ...
               },
               {
                    groupClass: 'addWorkspace',
                    allowedKeys: ['level1', 'level2'],
                    ...
               }
          ],
          contexts: [ context1, context2 ]
     },
     {
          metrics: [ ... ]
          contexts: [ ... ]
     }
]

@RidhamShah RidhamShah marked this pull request as ready for review April 25, 2024 06:33
@RidhamShah RidhamShah linked an issue May 2, 2024 that may be closed by this pull request
@zackcl
Copy link
Collaborator

zackcl commented May 7, 2024

@RidhamShah I'm getting the uncaughtException: column "context" of relation "metric" contains null values error when trying this branch. Should I clear my postgres database to make the branch work?

Update: Clearing the postgres DB fixed the error.

@zackcl
Copy link
Collaborator

zackcl commented May 7, 2024

@RidhamShah I've updated the METRICS in the .env file as the one in the .env.example file, but I don't see the pre-created metrics in the UI. Is there something I need to do in order to add the metrics defined in the .env file?

METRICS=[{"metrics":[{"metric":"totalTimeSeconds","datatype":"continuous"},{"groupClass":"masteryWorkspace","allowedKeys":["calculating_area_various_figures","Compare_functions_diff_reps_quadratic"],"attributes":[{"metric":"timeSeconds","datatype":"continuous"}]}],"contexts":["context_identifier_1"]}]
Screenshot 2024-05-07 at 11 49 02 AM

@zackcl
Copy link
Collaborator

zackcl commented May 7, 2024

Nevermind, I saw that you renamed the METRICS to PRE_DEFINED_METRICS in your PR.

@RidhamShah RidhamShah self-assigned this May 27, 2024
@ppratikcr7 ppratikcr7 merged commit 97bdd99 into dev Jun 3, 2024
8 checks passed
@ppratikcr7 ppratikcr7 deleted the 1295-appContext-in-metrics branch June 3, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Yoke metrics to app context - backend changes
4 participants