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

ci: add ADR lint and PR validation #713

Merged
merged 4 commits into from
Jul 6, 2023

Conversation

Amzani
Copy link
Collaborator

@Amzani Amzani commented Jul 3, 2023

Description

Fixes #677

@netlify
Copy link

netlify bot commented Jul 3, 2023

Deploy Preview for modest-rosalind-098b67 ready!

Name Link
🔨 Latest commit d3ed49e
🔍 Latest deploy log https://app.netlify.com/sites/modest-rosalind-098b67/deploys/64a68124aa65800008848f89
😎 Deploy Preview https://deploy-preview-713--modest-rosalind-098b67.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Jul 3, 2023

Deploy Preview for asyncapi-studio-design-system ready!

Name Link
🔨 Latest commit d3ed49e
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-studio-design-system/deploys/64a681242031d60007a5fa78
😎 Deploy Preview https://deploy-preview-713--asyncapi-studio-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

const title = context.payload.pull_request.title;
const labels = context.payload.pull_request.labels;
const hasAdrLabel = labels.some(label => label.name === 'kind/adr');
const re = /^chore:\s*\[ADR-(\d{4})\]/;
Copy link
Member

Choose a reason for hiding this comment

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

I see this considers ADR having a semantic title of chore. I think It would be great to drop semantic release titles and instead use changesets for studio. I will create an ADR for that and describe what changes needs to be considered for us. till then, I think we should not merge this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@KhudaDad414 I see your point and make sense, especially if we are planning to drop semantic release titles. However as the PR ADRs have no intent to trigger any release I'm wondering if we couldn't just create a new ADR repo for the AsyncAPI initiative and invite other projects to use it as well.

Any thoughts folks ?

Copy link
Member

Choose a reason for hiding this comment

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

I see the value but to be honest I'd not do it yet. We yet have to prove their value of them for us and I'd slowly roll it out on each project instead of doing it at once for the whole initiative. It will be easier for you to convince folks and adapt their workflow if you do it one by one.

Copy link
Member

Choose a reason for hiding this comment

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

@KhudaDad414 what if instead of blocking this PR we make the regex to either support chore: [ADR-NNNN] or [ADR-NNNN] as the title? This way we can already unblock this, start using ADRs, and as soon as the migration to changesets is done, we can remove the chore: [ADR-NNNN] option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've seen this in the doc

Since changesets are focused on releases and changelogs, changes to your repository that don't require these won't need a changeset. As such, we recommend not adding a blocking element to contributions in the absence of a changeset.

It means that contributors will only commit the ADR files without the need to bump a release or use changesets ?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, IMHO ADRs should not trigger a new release and, therefore, it shouldn't contain a changeset.

Copy link
Member

Choose a reason for hiding this comment

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

@fmvilas agreed. let's merge this one.

@sonarcloud
Copy link

sonarcloud bot commented Jul 6, 2023

Please retry analysis of this Pull-Request directly on SonarCloud.

@sonarcloud
Copy link

sonarcloud bot commented Jul 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.2% 0.2% Duplication

@KhudaDad414
Copy link
Member

@Amzani I have made the changes, please merge when ready. 🙇

@Amzani
Copy link
Collaborator Author

Amzani commented Jul 6, 2023

/rtm

@asyncapi-bot asyncapi-bot merged commit 4cff4b8 into asyncapi:master Jul 6, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a GitHub action to automate ADRs validation
4 participants