diff --git a/config/beta.yml b/config/beta.yml index be222bf..ea26f2a 100644 --- a/config/beta.yml +++ b/config/beta.yml @@ -110,7 +110,7 @@ roleGroups: emoji: '🇴' filterFeeds: - - jql: updated > lastRun + - jql: updated > {{lastRun}} jqlRemoved: '' channel: '665904688616701953' publish: true diff --git a/config/main.yml b/config/main.yml index ee9da72..f2d0956 100644 --- a/config/main.yml +++ b/config/main.yml @@ -90,7 +90,7 @@ roleGroups: filterFeeds: #java-triage - - jql: project = MC AND status changed by bugnet after lastRun + - jql: project = MC AND status changed BY bugnet AFTER {{lastRun}} channel: '1275197626719141888' # new channel #java-triage publish: true interval: 300000 @@ -99,7 +99,7 @@ filterFeeds: cached: false #java-fixes - - jql: project = MC AND resolved > lastRun AND resolution = Fixed AND fixVersion in unreleasedVersions() + - jql: project = MC AND resolved > {{lastRun}} AND resolution = Fixed AND fixVersion in unreleasedVersions() channel: '666349583227682819' publish: true interval: 30000 @@ -109,7 +109,7 @@ filterFeeds: cached: false # bedrock-fixes - - jql: project IN (MCPE, BDS) AND (resolution changed to Fixed after lastRun OR fixVersion changed after lastRun) AND fixVersion != EMPTY + - jql: project IN (MCPE, BDS) AND (resolution CHANGED TO Fixed AFTER {{lastRun}} OR fixVersion CHANGED AFTER {{lastRun}}) AND fixVersion != EMPTY channel: '974302728719314974' publish: true interval: 30000 @@ -120,51 +120,51 @@ filterFeeds: versionFeeds: #java-fixes - - projects: - - name: MC - id: 10400 - channel: '666349583227682819' - publish: true - interval: 10000 - scope: 5 - versionFeedEmoji: '🎉' - actions: - - released - - unreleased + - projects: + - name: MC + id: 10400 + channel: '666349583227682819' + publish: true + interval: 10000 + scope: 5 + versionFeedEmoji: '🎉' + actions: + - released + - unreleased #bedrock-fixes - - projects: - - name: MCPE - id: 10200 - channel: '974302728719314974' - publish: true - interval: 10000 - scope: 5 - versionFeedEmoji: '🎉' - actions: - - released - - unreleased + - projects: + - name: MCPE + id: 10200 + channel: '974302728719314974' + publish: true + interval: 10000 + scope: 5 + versionFeedEmoji: '🎉' + actions: + - released + - unreleased #version-feed - - projects: - - name: BDS - id: 11700 - - name: MC - id: 10400 - - name: MCL - id: 11101 - - name: MCPE - id: 10200 - - name: REALMS - id: 11402 - channel: "741600360619049000" - publish: false - interval: 10000 - scope: 5 - actions: - - created - - archived - - unarchived - - released - - unreleased - - renamed + - projects: + - name: BDS + id: 11700 + - name: MC + id: 10400 + - name: MCL + id: 11101 + - name: MCPE + id: 10200 + - name: REALMS + id: 11402 + channel: "741600360619049000" + publish: false + interval: 10000 + scope: 5 + actions: + - created + - archived + - unarchived + - released + - unreleased + - renamed diff --git a/config/template.yml b/config/template.yml index 8f86b34..4a3d404 100644 --- a/config/template.yml +++ b/config/template.yml @@ -215,7 +215,7 @@ filterFeeds: publish: # Whether the bot should cache tickets in the filter feed, - # If false, the property lastRun should be included in the jql, but when true, the filter feed will be less efficient. + # If false, the variable {{lastRun}} should be included in the jql, but when true, the filter feed will be less efficient. # Optional; true by default. cached: diff --git a/src/tasks/CachedFilterFeedTask.ts b/src/tasks/CachedFilterFeedTask.ts index 82aa845..2edc95b 100644 --- a/src/tasks/CachedFilterFeedTask.ts +++ b/src/tasks/CachedFilterFeedTask.ts @@ -8,6 +8,7 @@ import MojiraBot from '../MojiraBot.js'; export default class CachedFilterFeedTask extends Task { private static logger = log4js.getLogger( 'CachedFilterFeedTask' ); + private static lastRunRegex = /\{\{lastRun\}\}/g; private channel: TextBasedChannel; private jql: string; @@ -37,7 +38,7 @@ export default class CachedFilterFeedTask extends Task { this.lastRun = new Date().valueOf(); const searchResults = await MojiraBot.jira.issueSearch.searchForIssuesUsingJql( { - jql: this.jql.replace( 'lastRun', this.lastRun.toString() ), + jql: this.jql.replace( CachedFilterFeedTask.lastRunRegex, this.lastRun.toString() ), fields: ['key'], } ); @@ -53,7 +54,7 @@ export default class CachedFilterFeedTask extends Task { try { const searchResults = await MojiraBot.jira.issueSearch.searchForIssuesUsingJql( { - jql: this.jql.replace( 'lastRun', this.lastRun.toString() ), + jql: this.jql.replace( CachedFilterFeedTask.lastRunRegex, this.lastRun.toString() ), fields: ['key'], } ); @@ -72,7 +73,7 @@ export default class CachedFilterFeedTask extends Task { try { const ticketKeys = Array.from( this.knownTickets ); const previousTicketResults = await MojiraBot.jira.issueSearch.searchForIssuesUsingJql( { - jql: `${ this.jqlRemoved.replace( 'lastRun', this.lastRun.toString() ) } AND key in (${ ticketKeys.join( ',' ) })`, + jql: `${ this.jqlRemoved.replace( CachedFilterFeedTask.lastRunRegex, this.lastRun.toString() ) } AND key in (${ ticketKeys.join( ',' ) })`, fields: ['key'], } ); diff --git a/src/tasks/FilterFeedTask.ts b/src/tasks/FilterFeedTask.ts index ad760db..915c430 100644 --- a/src/tasks/FilterFeedTask.ts +++ b/src/tasks/FilterFeedTask.ts @@ -9,6 +9,7 @@ import { LoggerUtil } from '../util/LoggerUtil.js'; export default class FilterFeedTask extends Task { private static logger = log4js.getLogger( 'FilterFeedTask' ); + private static lastRunRegex = /\{\{lastRun\}\}/g; private channel: TextBasedChannel; private jql: string; @@ -39,7 +40,7 @@ export default class FilterFeedTask extends Task { try { const searchResults = await MojiraBot.jira.issueSearch.searchForIssuesUsingJql( { - jql: this.jql.replace( 'lastRun', this.lastRun.toString() ), + jql: this.jql.replace( FilterFeedTask.lastRunRegex, this.lastRun.toString() ), fields: ['key'], } );