chore: 🤖 Add feature flag for client-agent work (#2397)

This commit is contained in:
Zhihe Li authored and GitHub committed 2024-07-17 15:58:51 -04:00
1 parent cc0edf311c
commit bea40ec622
3 files changed
+18 -13

No files matched your search

+14 -9
View File
@@ -36,6 +36,7 @@ export default class ScopesScopeProjectsRoute extends Route {
@service clientAgentSessions;
@service pollster;
@service flashMessages;
@service features;
// =methods
@@ -48,18 +49,22 @@ export default class ScopesScopeProjectsRoute extends Route {
/**
* Primes the store with _all project scopes_ under global.
* @return {Promise{ScopeModel}}
* @return {Promise<ScopeModel>}
*/
async model() {
// Setup the poller job
if (!this.job) {
this.boundPoller = this.poller.bind(this);
this.job = this.pollster.findOrCreateJob(this.boundPoller, 2000);
}
if (this.features.isEnabled('client-agent')) {
// Setup the poller job
if (!this.job) {
this.boundPoller = this.poller.bind(this);
this.job = this.pollster.findOrCreateJob(this.boundPoller, 2000);
}
const isClientAgentRunning = await this.ipc.invoke('isClientAgentRunning');
if (isClientAgentRunning) {
this.job.start();
const isClientAgentRunning = await this.ipc.invoke(
'isClientAgentRunning',
);
if (isClientAgentRunning) {
this.job.start();
}
}
const { id: scope_id } = this.modelFor('scopes.scope');
@@ -14,6 +14,7 @@ export default class ScopesScopeProjectsSessionsSessionRoute extends Route {
@service clientAgentSessions;
@service flashMessages;
@service intl;
@service features;
// =methods
@@ -29,6 +30,7 @@ export default class ScopesScopeProjectsSessionsSessionRoute extends Route {
// If we don't have any credentials, we'll try to fetch them from the client agent in case this session
// was initiated through the client agent.
if (
this.features.isEnabled('client-agent') &&
!session.credentials.length &&
(await this.ipc.invoke('isClientAgentRunning'))
) {
+2 -4
View File
@@ -61,9 +61,7 @@ module.exports = function (environment) {
},
featureFlags: {
search: false,
filter: true,
'post-connection-workflow': false,
'client-agent': false,
},
};
@@ -84,7 +82,7 @@ module.exports = function (environment) {
: true;
// Enable features in development
ENV.featureFlags['post-connection-workflow'] = true;
ENV.featureFlags['client-agent'] = true;
}
if (environment === 'test') {