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

Merge down 6 0 10 #2154

Merged
merged 30 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dfb92e2
intial 6.0.0 version bump
danoswaltCL Oct 4, 2024
8c892eb
Decoupling join and paginated query
Oct 7, 2024
01060ae
Apply filterMode (includeAll) to an imported Feature Flag (#2031)
zackcl Oct 8, 2024
d4083b2
(Release) Refine Disabled Slide Toggles and Action Buttons on 'Reader…
zackcl Oct 8, 2024
47743d9
adding exposures to the feature flag paginated query
ppratikcr7 Oct 9, 2024
67b9dbf
Merge branch 'release/v6.0.0-prerelease' into bugfix/fixing-paginated…
ppratikcr7 Oct 9, 2024
e7bb64f
Bugfix/handy prerelease version bump script (#2033)
danoswaltCL Oct 9, 2024
0c4f4a8
Merge branch 'release/v6.0.0-prerelease' into bugfix/fixing-paginated…
danoswaltCL Oct 9, 2024
6ccf80b
v6-pre-release version update
ppratikcr7 Oct 9, 2024
27afa72
Merge pull request #2034 from CarnegieLearningWeb/bugfix/fixing-pagin…
ppratikcr7 Oct 9, 2024
26cfb5d
(Release) Fix Not-Allowed Cursor Appearing on Enabled Slide Toggles (…
zackcl Oct 11, 2024
10b823a
add var to turn off migrations for ECS (#2041)
bcb37 Oct 11, 2024
fc21cfa
use branch to build artifacts and deploy automatically to staging (#2…
shpwe Oct 14, 2024
74c1512
fix config string replacement (#2054) (#2063)
shpwe Oct 16, 2024
2c3e708
add quicktests for the clientlibs (#2081)
danoswaltCL Oct 30, 2024
3d0ef14
Bugfix for experiment data export storing condition name in condition…
ppratikcr7 Nov 8, 2024
d7b25e9
removed disable on context change in experiment edit modal (#2094)
Yagnik56 Nov 8, 2024
f6c4c6d
Revert Logging Property in the Overview Form (#2103)
zackcl Nov 11, 2024
b4c7c0b
hotfix to handle duplicate export data csv rows for marking multiple …
ppratikcr7 Nov 18, 2024
b8aa186
update to 6.0.5, ready for prod (#2118)
danoswaltCL Nov 19, 2024
aa14412
get export log data from replica (#2125)
bcb37 Nov 21, 2024
dfb995b
update filter mode when ALL row is removed in include table (#2131)
Yagnik56 Nov 26, 2024
b8e7279
match package version to build tags (#2138)
danoswaltCL Nov 26, 2024
efb0f7e
Update clientlib readme (#2139)
danoswaltCL Nov 26, 2024
8f55f4d
Hotfix: fix export data (#2141)
bcb37 Dec 5, 2024
fd0b44b
remove errorneous error logging and db inserts in group experiment as…
danoswaltCL Dec 5, 2024
19feb36
resolve merge conflicts 6.0.10
danoswaltCL Dec 9, 2024
3c39fdb
regenerate package locks
danoswaltCL Dec 9, 2024
df7a90e
add missing import
danoswaltCL Dec 9, 2024
3df8f62
Merge branch 'dev' into merge_down_6_0_10
ppratikcr7 Dec 10, 2024
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
95 changes: 87 additions & 8 deletions backend/packages/Upgrade/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { GroupExclusionRepository } from './GroupExclusionRepository';
import { DecisionPoint } from '../models/DecisionPoint';
import { MonitoredDecisionPointLog } from '../models/MonitoredDecisionPointLog';
import { ExperimentCondition } from '../models/ExperimentCondition';
import { MonitoredDecisionPointRepository } from './MonitoredDecisionPointRepository';
import { UserStratificationFactorRepository } from './UserStratificationRepository';
import _ from 'lodash';
import { Repository } from 'typeorm';
Expand Down Expand Up @@ -448,6 +447,7 @@ export class AnalyticsRepository extends Repository<AnalyticsRepository> {
.createQueryBuilder('individualEnrollment')
.select([
'"individualEnrollment"."userId" as "userId"',
'"individualEnrollment"."createdAt" as "createdAt"',
'"individualEnrollment"."groupId" as "enrollmentGroupId"',
'"individualEnrollment"."enrollmentCode" as "enrollmentCode"',
'"individualEnrollment"."experimentId" as "experimentId"',
Expand All @@ -467,39 +467,13 @@ export class AnalyticsRepository extends Repository<AnalyticsRepository> {
.addGroupBy('individualEnrollment.experimentId')
.addGroupBy('individualEnrollment.conditionId')
.addGroupBy('individualEnrollment.partitionId')
.addGroupBy('individualEnrollment.createdAt')
.addGroupBy('decisionPointData.site')
.addGroupBy('decisionPointData.target')
.orderBy('individualEnrollment.userId', 'ASC')
.where('individualEnrollment.experimentId = :experimentId::uuid', { experimentId });

const monitoredDecisionPointRepository = Container.getCustomRepository(MonitoredDecisionPointRepository, 'export');
const monitoredDecisionPointQuery = monitoredDecisionPointRepository
.createQueryBuilder('monitoredDecisionPoint')
.select([
'monitoredDecisionPoint.site as "site"',
'monitoredDecisionPoint.target as "target"',
'monitoredDecisionPoint.userId as "userId"',
'"monitoredPointLogs"."createdAt" as "markExperimentPointTime"',
])
.leftJoin('monitoredDecisionPoint.monitoredPointLogs', 'monitoredPointLogs')
.orderBy('monitoredDecisionPoint.userId', 'ASC')
.where('monitoredDecisionPoint.experimentId = :experimentId', { experimentId })
.andWhere(
'monitoredDecisionPoint.userId IN (' +
individualEnrollmentRepository
.createQueryBuilder('individualEnrollment')
.select('DISTINCT "individualEnrollment"."userId"')
.where('"individualEnrollment"."experimentId" = :experimentId::uuid', { experimentId })
.getQuery() +
')'
)
.setParameters(individualEnrollmentQuery.getParameters());

const [individualEnrollmentQueryResults, monitoredDecisionPointQueryResults] = await Promise.all([
individualEnrollmentQuery.getRawMany(),
monitoredDecisionPointQuery.getRawMany(),
]);

const individualEnrollmentQueryResults = await individualEnrollmentQuery.getRawMany();
const userStratificationFactorUserList = [];

const individualEnrollmentExperimentData = [];
Expand All @@ -526,6 +500,7 @@ export class AnalyticsRepository extends Repository<AnalyticsRepository> {
expConditionId: individualEnrollmentQueryResult.conditionId,
site: individualEnrollmentQueryResult.site,
target: individualEnrollmentQueryResult.target,
markExperimentPointTime: individualEnrollmentQueryResult.createdAt,
});
}
});
Expand All @@ -552,32 +527,14 @@ export class AnalyticsRepository extends Repository<AnalyticsRepository> {
userStratificationFactorQueryResult = await userStratificationFactorQuery.getRawMany();
}

// Group monitoredDecisionPointQueryResults by userId
const groupedMonitoredDecisionPointQueryResults = _.groupBy(monitoredDecisionPointQueryResults, 'userId');

// Combine data in a single flatMap step
const combinedCSVExportData = _.flatMap(individualEnrollmentExperimentData, (individualEnrollmentExperiment) => {
const userMonitoredResults =
groupedMonitoredDecisionPointQueryResults[individualEnrollmentExperiment.userId] || [];

return userMonitoredResults
.filter(
(monitoredDecisionPointQueryResult) =>
monitoredDecisionPointQueryResult.site === individualEnrollmentExperiment.site &&
monitoredDecisionPointQueryResult.target === individualEnrollmentExperiment.target
)
.map((monitoredDecisionPointQueryResult) => ({
...individualEnrollmentExperiment,
site: monitoredDecisionPointQueryResult.site,
target: monitoredDecisionPointQueryResult.target,
markExperimentPointTime: monitoredDecisionPointQueryResult.markExperimentPointTime,
stratificationValue: experimentsData.stratification
? userStratificationFactorQueryResult.find((user) => user.userId === individualEnrollmentExperiment.userId)
?.stratificationFactorValue
: null,
}));
});
return combinedCSVExportData;
return individualEnrollmentExperimentData.map((individualEnrollmentExperiment) => ({
...individualEnrollmentExperiment,
enrollmentGroupId: individualEnrollmentExperiment.groupId,
stratificationValue: experimentsData.stratification
? userStratificationFactorQueryResult.find((user) => user.userId === individualEnrollmentExperiment.userId)
?.stratificationFactorValue
: null,
}));
}

public async getCSVDataForWithInSubExport(experimentId: string): Promise<CSVExportDataRow[]> {
Expand Down
Loading
Loading