-
Notifications
You must be signed in to change notification settings - Fork 21
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(2911): Support pipeline metrics in templateFactory #583
Conversation
lib/templateFactory.js
Outdated
const metricPipelinesConfig = { | ||
params: { templateId: templateIds }, | ||
readOnly: true | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an optimal solution. This approach loads the all the fields of job objects from the DB to memory and perform aggregation here.
As we had discussed, we should enhance datastore-sequelize
to accept input and generate below SQL query so that the aggregation is performed at source (DB)
select count(distinct(pipelineId)), templateId
from jobs
group by templateId;
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
Remove comment Add filter Fix filter Update lib/templateFactory.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update test/lib/templateFactory.test.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update test/lib/templateFactory.test.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update lib/templateFactory.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update lib/templateFactory.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update lib/templateFactory.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update lib/templateFactory.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Improve test data Update lib/templateFactory.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update lib/templateFactory.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Update test/lib/templateFactory.test.js Co-authored-by: Dayanand Sagar <sagar1312@gmail.com> Fix pipelineUsage tests Remove unnecessary mocks Add test Verify calls Remove only
🎉 This PR is included in version 29.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
It has been requested that template maintainers are able to see who is using which version, so that once
a new version has been released, those using an old version can be notified.
Objective
Show the Pipelines that use a template version.
References
screwdriver-cd/screwdriver#2911
License
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.