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

#99 - Allow any entity scoring (Breaking changes) #132

Merged
merged 11 commits into from
Dec 14, 2022

Conversation

T0RAT0RA
Copy link
Contributor

@T0RAT0RA T0RAT0RA commented Dec 9, 2022

This PR enable any entity to be scored.

the URL to fetch json files is updated to be: {jsonDataUrl}/{entityRef.namespace}/{entityRef.kind}/{entityRef.name}.json

Key changes:

  • systemScore* variables renamed entityScore*
  • Deprecated interfaces: SystemScore, SystemScoreArea, SystemScoreEntry, SystemScoreExtended
  • New interfaces: EntityScore, EntityScoreArea, EntityScoreEntry, EntityScoreExtended
  • BREAKING: EntityScore has a mandatory key entityRef: CompoundEntityRef (replacement of SystemEntityName)

Scoring an API

// http://localhost:8090/plugins/score-card/sample-data/default/api/api.foo.json
{
  "entityRef": {
    "kind": "api",
    "name": "api.foo"
  },
  "generatedDateTimeUtc": "2021-07-22 10:00",
  "scorePercent": 57,
  ...
}

image

✔️ Checklist

  • Added tests for new functionality and regression tests for bug fixes
  • Added changeset (run yarn changeset in the root)
  • Screenshots of before and after attached (for UI changes)
  • Added or updated documentation (if applicable)

Making the change backward compatible with systemEntityName
This helps building backend proxy, as it will get the namespace and kind
of the entity scorecard
Copy link
Collaborator

@jvilimek jvilimek left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your tremendous work! And sorry for the delay with the review, I was not feeling well over the weekend. I will also try to check on the test case locally (later this wee).
Another big question is whenever we really need the backwards compatibility, as this makes the code pretty messy and complex.. how about to bump to 0.6 version with a breaking changes?

packages/app/src/components/catalog/EntityPage.tsx Outdated Show resolved Hide resolved
plugins/score-card/config.d.ts Outdated Show resolved Hide resolved
plugins/score-card/sample-data/all.json Show resolved Hide resolved
plugins/score-card/src/api/types.ts Outdated Show resolved Hide resolved
plugins/score-card/src/api/types.ts Outdated Show resolved Hide resolved
plugins/score-card/src/api/ScoringDataJsonClient.ts Outdated Show resolved Hide resolved
plugins/score-card/src/api/index.ts Outdated Show resolved Hide resolved
@T0RAT0RA
Copy link
Contributor Author

T0RAT0RA commented Dec 12, 2022

how about to bump to 0.6 version with a breaking changes

Yes, if you're OK with breaking changes, it will greatly simplify the refactor.
I'll update the PR and it will answer a lot of your comments.

@T0RAT0RA
Copy link
Contributor Author

I cleaned up the code and remove the deprecated types to make the code cleaner.
Next I'll look at the failing test and wrap up the documentation.

Thanks for your feedback!

Will be worked on in another PR
Keep same areaScores in all.json
@T0RAT0RA T0RAT0RA marked this pull request as ready for review December 13, 2022 20:45
Copy link
Collaborator

@jvilimek jvilimek left a comment

Choose a reason for hiding this comment

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

Nice! I have reviewed the last changes and it's OK.
Few last things: would you be please so kind and run also yarn changeset increasing the minor version and describing the breaking changes? Not sure, how this needs to be announced / added to the changeset ... I will take care about the backstage integration and also the SharePoint PowerShell integration.

Also WDYT about the current Readme? I guess we shall change the wording from system to entity...or I can do this in some follow-up PR.

@T0RAT0RA
Copy link
Contributor Author

I'll do the changeset tomorrow.

increasing the minor version

any particular reason why it's not a major version bump? Since it's a breaking change.

I'll also have another look at the README.

@jvilimek
Copy link
Collaborator

I'll do the changeset tomorrow.

Thanks!

any particular reason why it's not a major version bump? Since it's a breaking change.

We follow https://semver.org/ and since the package is still under development, the version starts with zero, it's 0.x.x. Thus increasing minor version is the only option here I believe.

I'll also have another look at the README.

Great, thanks!

@T0RAT0RA T0RAT0RA changed the title #99 - Allow any entity scoring #99 - Allow any entity scoring (Breaking changes) Dec 14, 2022
@T0RAT0RA
Copy link
Contributor Author

increasing minor version is the only option here I believe.

Yes you're right, TIL!

I've made the changes to the README and added a changeset.
Let me know if you need more changes.

Co-authored-by: Jan Vilimek <[email protected]>
Signed-off-by: T0RAT0RA <[email protected]>
Copy link
Collaborator

@jvilimek jvilimek left a comment

Choose a reason for hiding this comment

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

Great work, thanks!

@jvilimek jvilimek merged commit ec3991d into Oriflame:main Dec 14, 2022
T0RAT0RA added a commit to AlayaCare/backstage-plugins that referenced this pull request Dec 14, 2022
T0RAT0RA added a commit to AlayaCare/backstage-plugins that referenced this pull request Dec 14, 2022
T0RAT0RA added a commit to AlayaCare/backstage-plugins that referenced this pull request Dec 14, 2022
T0RAT0RA added a commit to AlayaCare/backstage-plugins that referenced this pull request Dec 14, 2022
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.

2 participants