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(model): Add the property Issue.affectedPath #7963

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion model/src/main/kotlin/Issue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.ossreviewtoolkit.model

import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.annotation.JsonSerialize
Expand Down Expand Up @@ -53,7 +54,13 @@ data class Issue(
/**
* The issue's severity.
*/
val severity: Severity = Severity.ERROR
val severity: Severity = Severity.ERROR,

/**
* The affected file or directory the issue is limited to, if any.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "the issue is related to" or "that causes the issue"?

*/
@JsonInclude(JsonInclude.Include.NON_NULL)
val affectedPath: String? = null
Copy link
Member

Choose a reason for hiding this comment

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

I'm not so happy with the name. affectedPath sounds like the file at this location is affected by the issue. For example, if a file system is corrupt, then files can be affected by this. But with the example of a ScanCode timeout, the timeout does not affect the file at all, the file is merely the cause of the issue because ScanCode cannot handle it for some reason.
Since we do not know what kinds of issues might make use of this property in future, shall we just call it filePath or path?

Copy link
Member

@sschuberth sschuberth Nov 30, 2023

Choose a reason for hiding this comment

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

But with the example of a ScanCode timeout, the timeout does not affect the file at all

Well, I'm reading it differently, like "What thing was affected by the timeout? The file, because it's contents were not properly scanned."

Since we do not know what kinds of issues might make use of this property in future, shall we just call it filePath or path?

As mentioned on Slack I was against filePath as also directories could be affected, and path sounds overly generic, though I could live with it. Maybe relatedPath?

Copy link
Member Author

Choose a reason for hiding this comment

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

I remove myself / my preference from this discussion and will implement what you guys agree @mnonnenmacher @sschuberth.

Copy link
Member

Choose a reason for hiding this comment

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

If both of you are happy with the current name please just go ahead.

) {
override fun toString(): String {
val time = if (timestamp == Instant.EPOCH) "Unknown time" else timestamp.toString()
Expand Down