Skip to content

feat: Add devfile with Node.js web app and MongoDB components #602

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

Merged
merged 4 commits into from
Apr 30, 2025

Conversation

svor
Copy link
Collaborator

@svor svor commented Apr 24, 2025

Description of Changes

In the registry I don't see any stack that provides a component with data base. So, this pull request introduces a devfile with two components:

Node.js Application: A component to develop and run a simple Node.js web application.

Mongo Database: A component to run MongoDB, which the Node.js app will connect to for data storage.

The project sample also includes the necessary deployment configurations, enabling the easy deployment of both the Node.js app and MongoDB to a K8S cluster.

This setup will allow developers to quickly start working on a full-stack application with a working MongoDB instance, all within a K8S environment. The configurations and components are designed to streamline development and deployment in K8S.

Related Issue(s)

eclipse-che/che#23351

Acceptance Criteria

  • Contributing guide

Have you read the devfile registry contributing guide and followed its instructions?

  • Test automation

Does this repository's tests pass with your changes?

  • Documentation

Does any documentation need to be updated with your changes?

  • Check Tools Provider

Have you tested the changes with existing tools, i.e. Odo, Che, Console? (See devfile registry contributing guide on how to test changes)

Tests Performed

Tested with Eclipse Che:

  • Started a workspace
  • Build and run the application
  • Check that the data is stored in DB
    screenshot-raw_githubusercontent_com-2025_04_24-16_33_21

screenshot-mail_google_com-2025_04_24-13_57_30

How To Test

Create a workspace on workspaces.openshift.com by clicking this button:
Open

Execute Run the application command

@svor svor self-assigned this Apr 24, 2025
@svor svor requested a review from a team as a code owner April 24, 2025 14:21
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.

In general looks good to me. Just added a comment in regards to the secret value

@@ -0,0 +1,77 @@
schemaVersion: 2.2.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we use 2.3.0 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ibuziuk looks like 2.3.0 schema version is not supported by odo v3 yet
see this comment: #602 (review)

@michael-valdron
Copy link
Member

/needs-rebase

EC check is failing as its missing recent patches in your branch.

@svor
Copy link
Collaborator Author

svor commented Apr 28, 2025

GH checks are failed because

unable to find schema for version "2.3.0". The parser supports devfile schema for version 2.0.0, 2.1.0, 2.2.0, v1alpha2

@michael-valdron @thepetk are you planning to add support for the 2.3.0 schema version in the PR checks?
Should I downgrade schemaVersion to 2.2.0 for now, or wait until 2.3.0 becomes valid?

@michael-valdron
Copy link
Member

GH checks are failed because

unable to find schema for version "2.3.0". The parser supports devfile schema for version 2.0.0, 2.1.0, 2.2.0, v1alpha2

@michael-valdron @thepetk are you planning to add support for the 2.3.0 schema version in the PR checks? Should I downgrade schemaVersion to 2.2.0 for now, or wait until 2.3.0 becomes valid?

@svor Error for odo v3 seems to be unrelated, let me retry. I'll open a bug report if the download link remains broken.

As for odo v2, this check should be skipped as it will never receive updates and there is plans to remove it (correct me if I'm wrong @thepetk). Looking at check_odov2.sh#L225 it appears we still need a skip condition for all 2.3.x versions, we have for 2.2.x versions. I can apply a quick fix.

@michael-valdron
Copy link
Member

#606 should unblock this.

@michael-valdron
Copy link
Member

/needs-rebase

@svor Try rebasing again.

@svor
Copy link
Collaborator Author

svor commented Apr 29, 2025

@michael-valdron thank you! Tests passed with odo v2, but I’m still encountering an issue with odo v3 check

@thepetk
Copy link
Contributor

thepetk commented Apr 29, 2025

/retest

Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

@svor Testing this locally I got the following error with odo v3 nightly build:

unable to parse devfile: error parsing devfile because of non-compliant data due to unable to find schema for version "2.3.0". The parser supports devfile schema for version 2.0.0, 2.1.0, 2.2.0, 2.2.1, 2.2.2, v1alpha2

Seems that odo has not implemented devfile 2.3.0 yet, so I'd recommend downgrading to devfile 2.2.2 (latest of 2.2.x devfiles and what odo v3 supports).

Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

@svor Also the starter project devfile version needs to be 2.2.2 as well:

  __
 /  \__     Initializing a new component
 \__/  \    
 /  \__/    odo version: v3.16.1 (a50a5d265-nightly)
 \__/

 ✓  Copying devfile from "../stacks/nodejs-mongodb/devfile.yaml" 
 ◓  Downloading starter project "nodejs-mongodb-sample"
====================================================================================================================================
⚠  A Devfile is present inside the starter project; replacing the entire content of the current directory with the starter project
====================================================================================================================================
 ✓  Downloading starter project "nodejs-mongodb-sample" [568ms]
 ✗  error parsing devfile because of non-compliant data due to unable to find schema for version "2.3.0". The parser supports devfile schema for version 2.0.0, 2.1.0, 2.2.0, 2.2.1, 2.2.2, v1alpha2

Signed-off-by: Valeriy Svydenko <[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 lgtm Looks good to me approved labels Apr 30, 2025
@thepetk
Copy link
Contributor

thepetk commented Apr 30, 2025

Looks good now. I'll let @michael-valdron review one last time and merge just in case there are any additional comments. For me is good to be merged.

Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

openshift-ci bot commented Apr 30, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michael-valdron, svor, 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:
  • OWNERS [michael-valdron,thepetk]

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

@thepetk thepetk merged commit 88b67ff into main Apr 30, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Looks good to me
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants