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

Add Last Modified Field For Non-Versioned Items #250

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

Jdubrick
Copy link
Contributor

Please specify the area for this PR

What does does this PR do / why we need it:
This PR adds the logic for setting the lastModified field for stacks/samples that do not have a version. Before this change any samples that did not have a version had the lastModified field set to the default time.Time value. This change allows for the dates to be set properly.

You can reference the conversation around this issue here: #249 (comment)

This PR is flagged as WIP because I believe the changes made to registry here may need to be merged first for tests to pass as it contains changes to how the last_modified.json is generated during build.

Which issue(s) this PR fixes:

Fixes devfile/api#1607

PR acceptance criteria:

  • Test Coverage
    • Are your changes sufficiently tested, and are any applicable test cases added or updated to cover your changes?

Documentation (WIP)

How to test changes / Special notes to the reviewer:
You should be able to test the following:

  • go test ./... for index/generator passes
  • go test ./... for index/server passes
  • Build the registry locally with the test data (bash build_registry.sh) and deploy it.
    • You should be able to see that the samples previously showing the default time are now set

Example of samples being set:

{
   "name": "java-springboot-basic",
   "displayName": "Basic Spring Boot",
   "description": "A simple Hello World Java Spring Boot application using Maven",
   "type": "sample",
   "tags": [
     "Java",
     "Spring"
   ],
   "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/spring.svg",
   "projectType": "springboot",
   "language": "java",
   "git": {
     "remotes": {
       "origin": "https://github.com/devfile-samples/devfile-sample-java-springboot-basic.git"
     }
   },
   "lastModified": "2024-02-15T11:45:48+01:00"
 },
 {
   "name": "python-basic",
   "displayName": "Basic Python",
   "description": "A simple Hello World application using Python",
   "type": "sample",
   "tags": [
     "Python"
   ],
   "icon": "https://www.python.org/static/community_logos/python-logo-generic.svg",
   "projectType": "python",
   "language": "python",
   "git": {
     "remotes": {
       "origin": "https://github.com/devfile-samples/devfile-sample-python-basic.git"
     }
   },
   "lastModified": "2024-02-15T11:45:48+01:00"
 }

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2024
Signed-off-by: Jordan Dubrick <[email protected]>
Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2024
Copy link

openshift-ci bot commented Jul 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jdubrick, thepetk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Jdubrick Jdubrick changed the title WIP: Add Last Modified Field For Non-Versioned Items Add Last Modified Field For Non-Versioned Items Jul 31, 2024
@Jdubrick Jdubrick merged commit d772b7f into devfile:main Jul 31, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update lastModified For Stacks/Samples Without Versions
2 participants