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(3266): make changes to models banner to include scope and scopeId #639

Merged
merged 11 commits into from
Jan 23, 2025

Conversation

VonnyJap
Copy link
Member

Context

The current banner schema is implemented at a global level, lacking any concept of scope or scopeId.

Objective

There are instances where a banner is required only at the pipeline or build level. This change incorporates this concept into the banner model.

References

screwdriver-cd/screwdriver#3266

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.

Comment on lines 55 to 68
if (config.scope === 'PIPELINE') {
const pipeline = await PipelineFactory.getInstance().get(config.scopeId);

if (!pipeline) {
throw new Error(`Pipeline ${config.scopeId} does not exist`);
}
}
if (config.scope === 'BUILD') {
const build = await BuildFactory.getInstance().get(config.scopeId);

if (!build) {
throw new Error(`Build ${config.scopeId} does not exist`);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we refactor the duplicate code block into a reusable function to validate the scopeId by choosing the appropriate factory based on the scope

VonnyJap and others added 4 commits January 22, 2025 22:58
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
VonnyJap and others added 2 commits January 23, 2025 08:49
Co-authored-by: Dayanand Sagar <sagar1312@gmail.com>
@VonnyJap VonnyJap merged commit 376280e into master Jan 23, 2025
2 checks passed
@VonnyJap VonnyJap deleted the banner-scope branch January 23, 2025 18:38
@sd-buildbot
Copy link

🎉 This PR is included in version 31.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants