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

fix(analysis): add compatibility rules class-declaration-abstractness-changed #974

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Mamatha1718
Copy link

@Mamatha1718 Mamatha1718 commented Dec 21, 2024

Title

class-declaration-abstractness-changed #974

See our DEVELOPERS guide below:
https://github.com/accordproject/concerto/blob/main/DEVELOPERS.md

Closes #974

Summary

This pull request introduces abstractness checks for class declarations to enhance compatibility and versioning analysis.

Changes

=> Added logic to compare isAbstract property in class declarations.
=> Retained existing type-change reports for class declarations.
=> Introduced new keys:
=> class-declaration-abstract-to-concrete: Classified as a minor change.
=> class-declaration-concrete-to-abstract: Classified as a major change.
=>Updated rules in compare-config.ts to reflect the above changes.+

Flags

=> Ensure the abstractness change handling aligns with other compatibility rules.
=> Breaking changes introduced by concrete-to-abstract modifications must be validated thoroughly.

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

Copy link

@DS-AdamMilazzo DS-AdamMilazzo left a comment

Choose a reason for hiding this comment

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

I'm sure the Concerto team would like to see something in the PR description.

@@ -54,11 +54,17 @@ const classDeclarationTypeChanged: ComparerFactory = (context) => ({
if (aType === bType) {
return;
}
context.report({

Choose a reason for hiding this comment

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

The existing type-change report shouldn't be removed. Instead, the if statement above should be inverted (aType !== bType or whatever) and the report should be put in there.

const changeSeverity = isAbstract(a) ? 'minor' : 'major';
context.report({
key: 'class-declaration-abstractness-changed',
message: `The class "${a.getName()}" changed from ${changeType} (${changeSeverity} change).`,

Choose a reason for hiding this comment

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

The severity can't simply be expressed in the message but must be defined here:

You'll need to create two different keys: one for abstract to concrete, and one for concrete to abstract.

Copy link
Author

@Mamatha1718 Mamatha1718 Dec 22, 2024

Choose a reason for hiding this comment

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

I have added the rules, and change the severity to changeKey.
The pull request is ready for review.
please let me know if any changes need.

@DS-AdamMilazzo
Copy link

It looks okay to me, but I'm not part of the Concerto team so they'll have to review it. I expect they would like to see a test, for example. I think you can search for the other result codes (keys) and find where the existing tests are.

@Mamatha1718
Copy link
Author

Mamatha1718 commented Dec 22, 2024 via email

@Mamatha1718
Copy link
Author

Mamatha1718 commented Dec 22, 2024 via email

@DS-AdamMilazzo
Copy link

I’m really interested in contributing to the Accord project, especially for GSoC 2025.

Thank you. I'm not part of the Accord/Concerto team, but I'd recommend asking @dselman or @mttrbrts, who are the principals behind it.

@sanketshevkar
Copy link
Member

Hi @Mamatha1718
Thanks for showing your interest. Can you please update your PR motivations and details in the description box?

I might also want to do a DCO signoff for your commits.

@@ -53,6 +53,8 @@ export const defaultCompareConfig: CompareConfig = {
'optional-property-added': CompareResult.PATCH,
'required-property-removed': CompareResult.MAJOR,
'optional-property-removed': CompareResult.MAJOR,
'class-declaration-abstract-to-concrete': CompareResult.MINOR,
'class-declaration-concrete-to-abstract': CompareResult.MAJOR,
Copy link
Member

Choose a reason for hiding this comment

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

How do we decide if the conversions results in a major/minor bump? Is there some sort of modelling convnetion for this?

Choose a reason for hiding this comment

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

It's major if existing data can become invalid (i.e. it's not backward-compatible). Otherwise, it's minor or patch. I don't know how they decide between those two. @mttrbrts ?

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @DS-AdamMilazzo, this result makes sense to me.

@Mamatha1718
Copy link
Author

Hi @Mamatha1718 Thanks for showing your interest. Can you please update your PR motivations and details in the description box?

I might also want to do a DCO signoff for your commits.
Hi @sanketshevkar,
I change PR description, Will you please let me know any other changes required.
Thank you!

Copy link
Contributor

This PR is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jan 19, 2025
@Mamatha1718
Copy link
Author

Mamatha1718 commented Jan 19, 2025

Hi @sanketshevkar, @DS-AdamMilazzo
I change PR description, Will you please let me know any other changes required.
Thank you!

@github-actions github-actions bot removed the Stale label Jan 20, 2025
@DS-AdamMilazzo
Copy link

Like I said, I'm not part of the Concerto team so I don't really know, but I'm sure @mttrbrts or @dselman know.

@Mamatha1718
Copy link
Author

Like I said, I'm not part of the Concerto team so I don't really know, but I'm sure @mttrbrts or @dselman know.

Hi @DS-AdamMilazzo ,Thank you for your response.

@mttrbrts mttrbrts changed the title class-declaration-abstractness-changed feat(analysis): add compatibility rules class-declaration-abstractness-changed Jan 22, 2025
@mttrbrts mttrbrts changed the title feat(analysis): add compatibility rules class-declaration-abstractness-changed fix(analysis): add compatibility rules class-declaration-abstractness-changed Jan 22, 2025
Copy link
Member

@mttrbrts mttrbrts left a comment

Choose a reason for hiding this comment

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

Approved.

@accordproject/maintainers I believe that this should considered a bug fix, and so am comfortable with releasing it in the next minor version release of Concerto.

@mttrbrts
Copy link
Member

@Mamatha1718 thank you for your first contribution! I'm happy to merge if you can fix the DCO sign-off.

@jamieshorten
Copy link
Collaborator

@Mamatha1718 this might be helpful for amending the commit messages to contain a sign off message: https://github.com/dcoapp/app#how-it-works

@Mamatha1718
Copy link
Author

Hi @mttrbrts Thanks for your response. I signed off DCO.

@Mamatha1718
Copy link
Author

Hi @jamieshorten , Thanks for your dcoapp files, that are help me to signoff DCO.
Thank you.

@mttrbrts
Copy link
Member

Hi @mttrbrts Thanks for your response. I signed off DCO.

There still appears to be an issue here, unfortunately.

You can manually sign-off in the browser here: https://github.com/accordproject/concerto/pull/974/checks?check_run_id=36014157838

@Mamatha1718
Copy link
Author

Hi @mttrbrts Thanks for your response. I signed off DCO.

There still appears to be an issue here, unfortunately.

You can manually sign-off in the browser here: https://github.com/accordproject/concerto/pull/974/checks?check_run_id=36014157838

Thank you for pointing that out earlier! I've reviewed the DCO status and successfully resolved the issue. The DCO check now shows a green checkmark, and all commits have been properly signed off.

Please let me know if there's anything else I need to address or if further action is required from my side.
Thank you.

@sanketshevkar
Copy link
Member

Hi @Mamatha1718
There is a ts-check failing can you please check it?

@Mamatha1718
Copy link
Author

Mamatha1718 commented Jan 23, 2025

Hi @Mamatha1718 There is a ts-check failing can you please check it?

Hi @sanketshevkar , i solve the issue with adding these
interface ClassDeclaration {
isAbstract(): boolean;
getName(): string;
}
const isAbstract = (declaration: ClassDeclaration) => declaration.isAbstract();
will you please check once.
Thank you.

@sanketshevkar
Copy link
Member

@Mamatha1718
Copy link
Author

Hi @sanketshevkar ,Thank you for pointing that out. I've removed the er.email file as requested. will you please let me know any changes required.
Thank you.

@sanketshevkar
Copy link
Member

PR check is still failing. Can you please remove the wq file as well?
Screenshot 2025-01-27 at 12 01 35 PM

@Mamatha1718
Copy link
Author

Mamatha1718 commented Jan 27, 2025

Hi @sanketshevkar ,
Thank you for your response! I have removed the unwanted wq file as requested. Please let me know if there are any other changes needed.
Thanks You!

@sanketshevkar
Copy link
Member

Here are steps which will help you signoff your commits https://github.com/accordproject/concerto/pull/974/checks?check_run_id=36240929516.

If you follow the instructions given there you should be able to signoff of your old commits.

@sanketshevkar
Copy link
Member

Also you might have to fix the linting errors as well. You can always try running the build, test and lint check commands in the package json to check if your changes are compatible with all the guardrails kept in place before making the commit.

The PR checks basically does the same thing before we merge the commits.

Thanks for having patience!

Signed-off-by: Mamatha Bandi <[email protected]>
@Mamatha1718 Mamatha1718 force-pushed the main branch 2 times, most recently from 4a7a65e to bf96d0d Compare January 31, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants