Skip to content

Conversation

@Leo-Send
Copy link

@Leo-Send Leo-Send commented Aug 26, 2025

Adds functionality for the following events:

  • issue_type_added
  • issue_type_changed
  • issue_type_removed
  • connected
  • reopened
  • parent_issue_added
  • parent_issue_removed
  • sub_issue_added
  • sub_issue_removed

@Leo-Send
Copy link
Author

Leo-Send commented Aug 26, 2025

I have a few open questions/issues regarding this PR:

  1. the 'connected' and 'subissue'/'parentissue' events do not contain any data on which issue the current issue is connected/related to. We could calculate this using timestamps, since both event types generate a counterpart in the connected/related issue. If we want to do this, I can look further into this.

  2. Until now, I was unable to generate the 'sub_issue_changed' and 'parent_issue_changed' events. It seems to me that the only allowed interaction with subissues is adding or removing them. Should I still keep those events?

  3. I am not sure about what I should do for the copyright headers, considering I only authored a change in one file so far.

Edit:
upon further investigation, all 'sub_issue' or 'parent_issue' event types do not appear in the REST api documentation. They do, however, appear in the graphQL api documentation and seem to behave the same in the REST api. But the 'sub_issue_changed' and 'parent_issue_changed' events do not exist there either.

@Leo-Send
Copy link
Author

Leo-Send commented Sep 5, 2025

Quick update regarding connected events:
It is trivial to save the event id in the output json. Since this event id is the same for the connected events in both issues, it is then possible to find the related issue. The question in where we want to do that - in our toolchain, I think it would be sensible to do it in codeface-extraction or coronet. Adding this functionality to the GitHubWrapper would require a lot of work and I also do not think it fits here. It should be by far easiest in coronet, assuming we save the event id during the codeface-extraction issue processing, for example in event-info 1 or 2. If we do not want this id in the issues.list file, it can also be done in codeface-extraction.

@bockthom
Copy link
Collaborator

bockthom commented Sep 8, 2025

Good idea!

I agree, it does not fit into the GitHubWrapper. So, just store it in the json file and we will find the related issue later.
While both codeface-extraction and coronet would be suitable for doing that, I'd prefer to do that in codeface-extraction, for two reasons:

(1) We do all the other processing in codeface-extraction. Why should we leave this one post-processing step to coronet? Would be inconsistent, I guess.
(2) When we would do this in coronet, we would need to recompute the connected issues every time we read issue data. Why should we do this every time and spend additional compute resources on that? If we do that in codeface-extraction, we do it only once, and the issues.list files contain already the correct linkage.

So, I'd suggest to compute the connected issue in codeface-extraction.

@Leo-Send
Copy link
Author

Leo-Send commented Sep 25, 2025

This PR is ready for review, but should be merged after PR #31 is merged.

@bockthom bockthom requested a review from Copilot October 21, 2025 00:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for handling new GitHub event types related to issue management, specifically: issue type changes, state changes (reopened), parent/sub-issue relationships, and connected events. The changes enhance the existing GitHub API wrapper to capture and process these additional event types.

Key changes include:

  • New data models for issue types (TypeData) and state reasons (StateReason)
  • Support for tracking sub-issues and external commits
  • Enhanced event processing for the newly supported event types
  • Improved commit hash extraction by filtering out code blocks

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
TypeData.java New data model for issue type information from GitHub's API
StateReason.java New enum for issue/PR state reasons (completed, reopened, not_planned, duplicate)
IssueDataProcessor.java Added sub-issue parsing, external commit tracking, and code block filtering in hash extraction
IssueData.java Added type field and sub-issues list to issue data model
GitHubRepository.java Added external commit URL fetching and registered new event processors
GitHubCommit.java Added external commit tracking flag
EventDataProcessor.java Added processors for state change, issue type change, and connected events
EventData.java Added new event data classes for state changes, issue type changes, parent/sub-issue changes, and connected events
README.md Added documentation about referenced events and data processing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bockthom
Copy link
Collaborator

I am satisfied with the changes in this PR. However, we also need to satisfy Copilot in this and the previous PR.
If the previous PR is updated, I can merge that one right away, such that this one can be rebased on top of the other one.

@bockthom
Copy link
Collaborator

And please add you copyright header to StateReason.java, since you have modified it yourself now.

external commits that reference an issue can now be fetched. They will
be marked with 'commitReferencesIssueExternal'. To that end, this commit
adds an 'external' field to each commit and a new method to extract
commits using the full url instead of just the relative one within the
repo.

Signed-off-by: Leo Sendelbach <[email protected]>
references to issues are now only found if they are ouside a code
environment (starting and ending with three '`'). This mirrors GitHubs
behaviour.

Signed-off-by: Leo Sendelbach <[email protected]>
Add paragraph that documents intended and unintended behaviour for
'referenced' events

Signed-off-by: Leo Sendelbach <[email protected]>
reformat README and nested if statement

Signed-off-by: Leo Sendelbach <[email protected]>
change BE words for consistency

Signed-off-by: Leo Sendelbach <[email protected]>
Signed-off-by: Leo Sendelbach <[email protected]>
Getter previously did not use method parameter. Also renamed and added
docs to match existing methods.

Signed-off-by: Leo Sendelbach <[email protected]>
Leo-Send and others added 12 commits October 31, 2025 15:44
using stringbuilder instead of appending, which would result in copying
the string

Signed-off-by: Leo Sendelbach <[email protected]>
introduce new state reason and type data classes

Signed-off-by: Shiraz Jafri <[email protected]>
Add new event data subclass for state changed events

Signed-off-by: Shiraz Jafri <[email protected]>
Add new enum and eventdata subclasses to track changes in issue types

Signed-off-by: Shiraz Jafri <[email protected]>
no longer serializing change_type field in IssueTypeChangedEventData

Signed-off-by: Shiraz Jafri <[email protected]>
Introduce new subclasses for parent and subissue events

Signed-off-by: Shiraz jarfi <[email protected]>
Introduce new event data subclass for connected events

Signed-off-by: Shiraz Jafri <[email protected]>
key was duplicated with different values, overwriting previous entry

Signed-off-by: Leo Sendelbach <[email protected]>
also add event ids and subissue numbers to data

SHA-1 extraction now only recognises hexadecimal strings length 7 and
above (previously 5)
Issue and Event data are extended by simple fields to hold event ids and
subissue numbers

Signed-off-by: Leo Sendelbach <[email protected]>
also fix copyright headers in new files

Signed-off-by: Leo Sendelbach
Parernt- and Subissues can not have a 'changed' event
None and Any state reasons were not achievable
Also removed the state reason field from issue data
StateChangedEvents can now have a commit (issues can be closed by a
commit)

Signed-off-by: Leo Sendelbach <[email protected]>
instead of assigning completed as default case, now throw an error. If
new state reasons are added later on githubs side, the occurence of this
error should prevent us from not noticing that change.

Signed-off-by: Leo Sendelbach <[email protected]>
suggestions contain a codeblock using the suggestion keyword after
opening the block. Add a field to reviewCommentData and result json for
this boolean

Signed-off-by: Leo Sendelbach <[email protected]>
@bockthom bockthom requested a review from Copilot November 4, 2025 07:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.

Comments suppressed due to low confidence (2)

src/de/uni_passau/fim/gitwrapper/EventDataProcessor.java:1

  • The inner class StateChangedEventData is declared as public class inside EventData.java, but should be declared as public static class to match the pattern of other inner event classes like ReferencedEventData and LabeledEventData in the same file.
/**

src/de/uni_passau/fim/gitwrapper/IssueDataProcessor.java:431

  • Variable 'String stateReasonValue' is never read.
        String stateReasonValue = (stateReasonElement != null && !stateReasonElement.isJsonNull()) 
            ? stateReasonElement.getAsString() 
            : null;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Fixes:
- case sensitive check for suggestion
- minor spelling issue
- artifact from state reasons in issue data
- debug comment
- copyright headers

Signed-off-by: Leo Sendelbach <[email protected]>
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.

3 participants