clearlydefined / clearlydefined/service

Copyright attribution fields auto highlighting and showing in PR when there was no intent to curate them

Open
#677 5 comments 0 reactions 0 assignees View on GitHub
bug reproducible
Dominant language
TypeScript
Stars
51
Forks
46
PR merge metrics
No merged PRs in 30d

Description

**Issue Type:** Bug
**Issue Description:**

I've encountered an interesting UI bug where one file-level copyright attribution was highlighted even though I did not actually update it.

It happened to me when I was curating the file-level licenses on following component:

https://clearlydefined.io/definitions/git/github/agershun/alasql/dc00c4dbf0346b78b56064f591e68b1834bbfa87

I went to curate the license of a file called "require.js", but before I clicked on the "licenses" column/field, I noticed the "copyrights" column/field appeared already "edited" (highlighted in blue) despite the fact that I never actually touched it.

2019-11-26_11-35-04

When I curated the license and submitted my changes in PR https://github.com/clearlydefined/curated-data/pull/2886, I notice that the copyright attributions were also present (with their already existing values) although I never intended to update them.

See: https://github.com/clearlydefined/curated-data/pull/2886/commits/a9d90e7739d3c6f10e51ef37568d2ee5e18c0d45 for the commit itself.

The steps I recall to recreate are the following:

1. Navigate to a component.

I've already curated _alasql@dc00c4db_, but the bug was (partly) re-producable on my end with a different version _alasql@9a1d2f4_. See bottom for my further full tests in dev.

Link: https://clearlydefined.io/definitions/git/github/agershun/alasql/9a1d2f4355cfb8cba94492ba5334bf6275358d61

2. Search for a discovered license in the file list using the column filter. In this case I did "MIT".

2019-11-26_12-28-38

3. Take notice that all visible copyright attributions are already highlighted despite not directly touching them!

2019-11-26_12-29-04

4. Now try to curate one of the file licenses and you will see that because the copyright attributes are also staged for curation, they will also be in the scope of your submission.

NOTE: After further testing in dev, I made the observation that the above does indeed happen but ONLY to the files you have actually intended to stage for curation (so in this case, the ones I actually did update the license for). So for example, if I only curate two out of the say 5 files that have their copyright statements highlighted, then only those two will actually be in the PR (show as both license PLUS the (unintended) copyright attribution curated).

See the two additional test curation PRs in dev:
https://github.com/clearlydefined/curated-data-dev/pull/962/commits/2cf0eaffb2a2e8c4b32e3b7ac27dead702fe33b4
https://github.com/clearlydefined/curated-data-dev/pull/963/commits/afd7aed86e1e7ee13b80a9adcedf8b88dbb800e1

For the last one, I got screenshots of before/after:

Before curating file license:
2019-11-26_12-47-14

After curating file license:
2019-11-26_12-44-08

And the contents of the PR _afd7aed_ once committed (i.e. after I press "Contribute" and add PR comments):
```
files:
- attributions:
- Copyright 2017 The Kubernetes Authors.
license: OTHER
path: vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/conversion.go
- attributions:
- Copyright 2017 The Kubernetes Authors.
license: OTHER
path: vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/deepcopy.go
```

I tried the above on both Google Chrome 78.x and Microsoft Edge 44.x with caches cleared with same results.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior in the ClearlyDefined component pages using the documented alasql definitions and file-list license filter. Compare the highlighted copyright fields with the generated curated-data PRs, including #2886 and the dev PRs #962 and #963; done means untouched attributions are neither highlighted nor included when only a license is curated.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.