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: extract artifactory timestamps from columns #33187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Arc676
Copy link

@Arc676 Arc676 commented Dec 18, 2024

Changes

The assumptions for the Artifactory datasource are tweaked to allow for additional information to be provided in the table. Instead of assuming that only a timestamp is present, assume that there are columns (separated by at least 2 spaces) and that only one of them contains a valid date.

The unit tests for the Artifactory datasource are adjusted to test this new change.

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@CLAassistant
Copy link

CLAassistant commented Dec 18, 2024

CLA assistant check
All committers have signed the CLA.

@Arc676 Arc676 changed the title Artifactory timestamps feat: extract artifactory timestamps from columns Dec 18, 2024
@Arc676 Arc676 marked this pull request as ready for review December 18, 2024 12:00
@Arc676 Arc676 force-pushed the artifactory-timestamps branch from dfda1cd to 903b284 Compare December 20, 2024 07:21
@@ -114,6 +115,8 @@ export class ArtifactoryDatasource extends Datasource {
}

private static parseReleaseTimestamp(rawText: string): string {
return rawText.trim().replace(regEx(/ ?-$/), '') + 'Z';
return (
rawText.split(regEx(/\s{2,}/)).filter(e => DateTime.fromFormat(e, "dd-LLL-yyyy HH:mm").isValid)[0] + 'Z'
Copy link
Collaborator

Choose a reason for hiding this comment

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

@viceice I would have preferred not to make this datetime refactor as part of this fix

@Arc676 Arc676 force-pushed the artifactory-timestamps branch from 2e8ac09 to b81015b Compare December 24, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants