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

Evaluate if Workflowgraph should be stored in the config #3171

Closed
VonnyJap opened this issue Aug 14, 2024 · 0 comments
Closed

Evaluate if Workflowgraph should be stored in the config #3171

VonnyJap opened this issue Aug 14, 2024 · 0 comments
Assignees
Milestone

Comments

@VonnyJap
Copy link
Member

What happened:

Current implementation of the workflowgraph for a pipeline template is persistently stored in the db during the creation of the template. It is part of the schema config of the pipeline template.

What you expected to happen:

We need to decide if workflowgraph should be produced on demand or to be stored in the config file. There will be required downstream change if this is part of the schema config. Please see this link.

How to reproduce it:

Running a query against db shows that the workflowgraph is being saved in the config.

const sqlite3 = require('sqlite3').verbose();

// Open the database
let db = new sqlite3.Database('./mw-data/storage.db', (err) => {
    if (err) {
        console.error(err.message);
    }
    console.log('Connected to the database.');
});

// Run a query
db.serialize(() => {
  db.each(`SELECT id, config from pipelineTemplateVersions`, (err, row) => {
      if (err) {
          console.error(err.message);
      }
      console.log(row);
  });
});

// Close the database
db.close((err) => {
    if (err) {
        console.error(err.message);
    }
    console.log('Closed the database connection.');
});

Result

% node db.js    
Connected to the database.
{
  id: 1,
  config: '{"parameters":{"nameA":"value1"},"jobs":{"main":{"image":"golang","environment":{"FOO":"BAR"},"requires":["~pr","~commit"],"steps":[{"echofoo":"echo $FOO"},{"echobar":"echo $BAR"}],"annotations":{},"settings":{},"secrets":[],"sourcePaths":[]},"extra":{"image":"golang","environment":{"FOO":"BAR"},"requires":["main"],"steps":[{"name":"echo \\"pipeline template test\\""}],"annotations":{},"settings":{},"secrets":[],"sourcePaths":[]}}}'
}
{
  id: 2,
  config: '{"parameters":{"nameA":"value1"},"jobs":{"main":{"image":"golang","environment":{"FOO":"BAR"},"requires":["~pr","~commit"],"steps":[{"echofoo":"echo $FOO"},{"echobar":"echo $BAR"}],"annotations":{},"settings":{},"secrets":[],"sourcePaths":[]},"extra":{"image":"golang","environment":{"FOO":"BAR"},"requires":["main"],"steps":[{"name":"echo \\"pipeline template test\\""}],"annotations":{},"settings":{},"secrets":[],"sourcePaths":[]}},"workflowGraph":{"nodes":[{"name":"~pr"},{"name":"~commit"},{"name":"main"},{"name":"extra"}],"edges":[{"src":"~pr","dest":"main"},{"src":"~commit","dest":"main"},{"src":"main","dest":"extra","join":true}]}}'
}
@sagar1312 sagar1312 self-assigned this Aug 29, 2024
@sagar1312 sagar1312 added this to the M1 milestone Aug 29, 2024
This was referenced Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants