Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions dist/breaking-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Breaking changes can be released with a new major version at most once every two

Example of breaking changes are removal of keys or changes to key types.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`.
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
4 changes: 2 additions & 2 deletions dist/bugfix-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ this means that this change won't break any compatibility with the old versions

Example of bugfix changes are typo fixes.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`.
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
4 changes: 2 additions & 2 deletions dist/deprecation-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Thanks for your contribution :pray:
This is now marked as a [`deprecation-change` proposal to the standard](https://github.com/publiccodeyml/publiccode.yml/labels/standard-deprecation), this means that this change won't break any compatibility with the old versions of the Standard,
and it will be possibile to make the definitive change 6 months after the deprecation with a new major release.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
19 changes: 18 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8969,6 +8969,22 @@ function reactToComment(context) {
});
}
exports.reactToComment = reactToComment;
function getNextVoteDate() {
const now = new Date();
const year = now.getFullYear();
const schedule = [
new Date(year, 0 /* Jan */, 30),
new Date(year, 4 /* May */, 30),
new Date(year, 8 /* Sep */, 30),
];
const next = schedule.find(d => d > now);
const nextDate = next !== null && next !== void 0 ? next : new Date(year + 1, schedule[0].getMonth(), schedule[0].getDate());
return nextDate.toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric',
});
}
function toMustacheView(context) {
var _a, _b, _c;
return {
Expand All @@ -8977,6 +8993,7 @@ function toMustacheView(context) {
maintainers_team: config_1.MAINTAINERS_TEAM,
steering_committee_team: config_1.STEERING_COMMITTEE_TEAM,
comment_author_username: (_c = (_b = (_a = context.payload.comment) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.login) !== null && _c !== void 0 ? _c : '',
next_vote_date: getNextVoteDate(),
};
}
function commentToIssue(context, template, additionalVariables) {
Expand Down Expand Up @@ -9427,7 +9444,7 @@ This proposal can be put to vote again in 90 days (using \`${config_1.BOT_USERNA
resultMessage = `
${resultMessage}

cc @${config_1.CHAIR_TEAM} @${config_1.MAINTAINERS_TEAM}
cc @${config_1.MAINTAINERS_TEAM}
`;
const vars = {
vote_thumbs_ups_tags: thumbsUpsTags.join(' '),
Expand Down
4 changes: 2 additions & 2 deletions dist/minor-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ this means that old versions of `publiccode.yml` will still be valid with this c

Example of minor changes are additions of new keys or making keys optional.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
2 changes: 1 addition & 1 deletion dist/national-section.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This is now marked as a national section change to the Standard and it will requ

[National section rules](https://github.com/publiccodeyml/publiccode.yml/blob/main/governance/procedure-proposing-changes-and-voting.md#country-specific-sections)

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
1 change: 0 additions & 1 deletion dist/vote-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
If you are a member of the [Steering Committee](https://github.com/publiccodeyml/publiccode.yml/blob/main/governance/charter.md#steering-committee-publiccodeymlsteering-committee) you can now vote!

The polls will stay open for {{ vote_period_days }} days, until **{{ vote_end_date }}**.
At the end of that period the Chair (@{{ chair_team }}) will mark the voting period as over using `@{{ bot_username }} vote-end`

Leave a :+1: (thumbs up) **on this comment** to accept the proposal or a :-1: (thumbs down) to reject it.

Expand Down
22 changes: 22 additions & 0 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface TemplateVariables {
steering_committee_team: string;
bot_username: string;
comment_author_username: string;
next_vote_date: string;
}

export interface Command {
Expand Down Expand Up @@ -62,13 +63,34 @@ export async function reactToComment(context: Context) {
});
}

function getNextVoteDate() {
const now = new Date();
const year = now.getFullYear();

const schedule = [
new Date(year, 0 /* Jan */, 30),
new Date(year, 4 /* May */, 30),
new Date(year, 8 /* Sep */, 30),
];

const next = schedule.find(d => d > now);
const nextDate = next ?? new Date(year + 1, schedule[0]!.getMonth(), schedule[0]!.getDate());

return nextDate.toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric',
});
}

function toMustacheView(context: Context): TemplateVariables {
return {
bot_username: BOT_USERNAME,
chair_team: CHAIR_TEAM,
maintainers_team: MAINTAINERS_TEAM,
steering_committee_team: STEERING_COMMITTEE_TEAM,
comment_author_username: context.payload.comment?.user?.login ?? '',
next_vote_date: getNextVoteDate(),
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/commands/voteEnd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from 'fs';
import { Context } from '@actions/github/lib/context';
import { GetResponseDataTypeFromEndpointMethod } from '@octokit/types';
import { BOT_USERNAME, CHAIR_TEAM, MAINTAINERS_TEAM } from '../config';
import { BOT_USERNAME, MAINTAINERS_TEAM } from '../config';
import {
reactToComment, commentToIssue, addLabels, removeLabel,
} from '../bot';
Expand Down Expand Up @@ -129,7 +129,7 @@ export default async function run(context: Context) {
const thumbsDownsTags = thumbsDowns.map(r => `@${r.user?.login}`);

let resultMessage = '';
const voteDetailsNotes: string [] = [];
const voteDetailsNotes: string[] = [];

await removeLabel(context, 'vote-start');

Expand Down Expand Up @@ -191,7 +191,7 @@ This proposal can be put to vote again in 90 days (using \`${BOT_USERNAME} vote-
resultMessage = `
${resultMessage}

cc @${CHAIR_TEAM} @${MAINTAINERS_TEAM}
cc @${MAINTAINERS_TEAM}
`;

const vars = {
Expand Down
4 changes: 2 additions & 2 deletions src/templates/breaking-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Breaking changes can be released with a new major version at most once every two

Example of breaking changes are removal of keys or changes to key types.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`.
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
4 changes: 2 additions & 2 deletions src/templates/bugfix-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ this means that this change won't break any compatibility with the old versions

Example of bugfix changes are typo fixes.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`.
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
4 changes: 2 additions & 2 deletions src/templates/deprecation-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Thanks for your contribution :pray:
This is now marked as a [`deprecation-change` proposal to the standard](https://github.com/publiccodeyml/publiccode.yml/labels/standard-deprecation), this means that this change won't break any compatibility with the old versions of the Standard,
and it will be possibile to make the definitive change 6 months after the deprecation with a new major release.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
4 changes: 2 additions & 2 deletions src/templates/minor-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ this means that old versions of `publiccode.yml` will still be valid with this c

Example of minor changes are additions of new keys or making keys optional.

The Chair will eventually pick up this proposal and start the voting procedure using `@{{ bot_username }} vote-start`
The next eligible voting round will take place on **{{ next_vote_date }}**

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
2 changes: 1 addition & 1 deletion src/templates/national-section.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This is now marked as a national section change to the Standard and it will requ

[National section rules](https://github.com/publiccodeyml/publiccode.yml/blob/main/governance/procedure-proposing-changes-and-voting.md#country-specific-sections)

cc @{{ chair_team }} @{{{ steering_committee_team }}}
cc @{{{ steering_committee_team }}}
1 change: 0 additions & 1 deletion src/templates/vote-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
If you are a member of the [Steering Committee](https://github.com/publiccodeyml/publiccode.yml/blob/main/governance/charter.md#steering-committee-publiccodeymlsteering-committee) you can now vote!

The polls will stay open for {{ vote_period_days }} days, until **{{ vote_end_date }}**.
At the end of that period the Chair (@{{ chair_team }}) will mark the voting period as over using `@{{ bot_username }} vote-end`

Leave a :+1: (thumbs up) **on this comment** to accept the proposal or a :-1: (thumbs down) to reject it.

Expand Down