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

feat: release date #5960

Closed

Conversation

ViralRuparel
Copy link
Contributor

Adds releaseTimeStamp to the PR updates table.

Closes #5822

@ViralRuparel
Copy link
Contributor Author

Here is the result after adding timeStamp. @rarkins what so you think, should it be kept as show in the screenshot(in change column) or make a new column.(something like releaseTime).

image

@rarkins
Copy link
Collaborator

rarkins commented Apr 13, 2020

Shouldn’t be in any column by default yet and it needs to be formatted as discussed in the issue.

@rarkins
Copy link
Collaborator

rarkins commented Apr 13, 2020

Looks like you need to update your prettier version too btw

@ViralRuparel
Copy link
Contributor Author

Shouldn’t be in any column by default yet and it needs to be formatted as discussed in the issue.

Yeah I will format as we discussed to support all 4 formats, but just wanted to know the default placement of it in the PR(if not in any column of the table).

@rarkins
Copy link
Collaborator

rarkins commented Apr 13, 2020

No default placement yes but add it to allowed template fields

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Do not make any changes to the default tables
  • Instead, add a new field to upgrades called releaseDate, which is formatted like below:

If less than a year old, make it like 01-Jan.
If more than a year old, make it like 01-Jan-2018

@@ -1595,7 +1595,7 @@ const options: RenovateOptions[] = [
Update: '{{{updateType}}}',
'Current value': '{{{currentValue}}}',
'New value': '{{{newValue}}}',
Change: '`{{{displayFrom}}}` -> `{{{displayTo}}}`',
Change: '`{{{displayFrom}}}` -> `{{{displayTo}}}` {{{releaseTimestamp}}}',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Change: '`{{{displayFrom}}}` -> `{{{displayTo}}}` {{{releaseTimestamp}}}',
Change: '`{{{displayFrom}}}` -> `{{{displayTo}}}`',

revert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@@ -14,6 +14,6 @@ export const defaultConfig = {
versioning: npmVersioning.id,
prBodyDefinitions: {
Change:
"[{{#if displayFrom}}`{{{displayFrom}}}` -> {{else}}{{#if currentValue}}`{{{currentValue}}}` -> {{/if}}{{/if}}{{#if displayTo}}`{{{displayTo}}}`{{else}}`{{{newValue}}}`{{/if}}](https://renovatebot.com/diffs/npm/{{replace '/' '%2f' depName}}/{{{fromVersion}}}/{{{toVersion}}})",
"[{{#if displayFrom}}`{{{displayFrom}}}` -> {{else}}{{#if currentValue}}`{{{currentValue}}}` -> {{/if}}{{/if}}{{#if displayTo}}`{{{displayTo}}}`{{else}}`{{{newValue}}}`{{/if}}](https://renovatebot.com/diffs/npm/{{replace '/' '%2f' depName}}/{{{fromVersion}}}/{{{toVersion}}}) {{#if releaseTimestamp}}({{{releaseTimestamp}}}){{/if}}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

@@ -44,6 +44,7 @@ export const allowedFields = {
depType: 'The dependency type (if extracted - manager-dependent)',
displayFrom: 'The current value, formatted for display',
displayTo: 'The to value, formatted for display',
releaseTimestamp: 'The release timeStamp of the newer version',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
releaseTimestamp: 'The release timeStamp of the newer version',
releaseDate: 'The release date of the newer version',

@@ -11,7 +11,7 @@ import { getControls } from './controls';
import { BranchConfig } from '../../common';

function massageUpdateMetadata(config: BranchConfig): void {
config.upgrades.forEach((upgrade) => {
config.upgrades.forEach(upgrade => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update your prettier (e.g. run yarn to update node_modules) and then run yarn prettier-fix to revert this change.

@@ -13,6 +13,7 @@ function getTableDefinition(config: BranchConfig): TableDefinition[] {
const value = config.prBodyDefinitions[header];
res.push({ header, value });
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert all changes in this file

@rarkins rarkins closed this May 1, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display age/release date for updates
2 participants