Skip to content

Enhance the codeface data for testing - #286

Merged
bockthom merged 7 commits into
se-sic:devfrom
maxloeffler:dev
Aug 23, 2025
Merged

Enhance the codeface data for testing#286
bockthom merged 7 commits into
se-sic:devfrom
maxloeffler:dev

Conversation

@maxloeffler

@maxloeffler maxloeffler commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

Prerequisites

  • I adhere to the coding conventions (described here) in my code.
  • I have updated the copyright headers of the files I have modified.
  • I have written appropriate commit messages, i.e., I have recorded the goal, the need, the needed changes, and the location of my code modifications for each commit. This includes also, e.g., referencing to relevant issues.
  • I have put signed-off tags in all commits.
  • I have updated the changelog file NEWS.md appropriately.
  • I have checked whether I need to adjust the showcase file showcase.R with respect to my changes.
  • The pull request is opened against the branch dev.

Description

Enhance the codeface data used for testing to include two new corner cases. Additionally, maintain consistency in the commit ids between proximity and feature data.

Changelog

  • Ensure that commit ids are unique between proximity and feature codeface data
  • Adjust codeface data s.t. one commit touches multiple files / functions
  • Adjust codeface data s.t. there are commits by different authors that are issued at the same time
  • Retain correct order in data when adding data from additional data sources, e.g., synchronicity data.

Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
@codecov

codecov Bot commented Jul 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.55%. Comparing base (3430c44) to head (5d67bb3).
⚠️ Report is 8 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #286      +/-   ##
==========================================
+ Coverage   82.34%   82.55%   +0.20%     
==========================================
  Files          16       16              
  Lines        5371     5378       +7     
==========================================
+ Hits         4423     4440      +17     
+ Misses        948      938      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maxloeffler

Copy link
Copy Markdown
Contributor Author

@bockthom @hechtlC To follow up our last meeting I have investigated the other uses of the merge function to see if the reordering problem appears else were. There are several unproblematic uses of merge but there are, as mentioned, two where I am not 100% certain. Those two are in update.commit.interactions and update.commit.message.data.

If I remember correctly, @Leo-Send mentioned that commit interaction data is separate but does that exclude it from having to be ordered by date? Currently, there is no reordering after merge being done even though there is a date field in the data.

The update.commit.message.data function merges data onto commits.unfiltered (which is being sorted in other instances) but there is again no reordering being done after merge. I can add the reordering, but first I wanted to make sure if there is a reason for why there is none currently.

@bockthom

Copy link
Copy Markdown
Collaborator

If I remember correctly, @Leo-Send mentioned that commit interaction data is separate but does that exclude it from having to be ordered by date? Currently, there is no reordering after merge being done even though there is a date field in the data.

Could you please check if the commit-interaction data is sorted anywhere by any column (e.g., upon reading, etc.) - if there is an ordering assumed, we might think about ensuring the ordering even after merging...

The update.commit.message.data function merges data onto commits.unfiltered (which is being sorted in other instances) but there is again no reordering being done after merge. I can add the reordering, but first I wanted to make sure if there is a reason for why there is none currently.

I don't know any reason for that. I guess we simple have overlooked this or we did not care about any ordering.

@maxloeffler

Copy link
Copy Markdown
Contributor Author

Could you please check if the commit-interaction data is sorted anywhere by any column (e.g., upon reading, etc.) - if there is an ordering assumed, we might think about ensuring the ordering even after merging...

Commit interaction data is indeed never ordered. Now the question is, should it be? Every other major data source seems to be ordered in some way, commits, issues and mails by date, authors by id etc.

@maxloeffler

Copy link
Copy Markdown
Contributor Author

Regarding update.commit.message.data I found out that when the ordering of commit messages does not align with the ordering of commits that the merge call destroys the ordering of commits. Commit message data is not ordered upon reading so I think it is best to enforce an ordering after the merge call here.

@bockthom

Copy link
Copy Markdown
Collaborator

Commit interaction data is indeed never ordered. Now the question is, should it be? Every other major data source seems to be ordered in some way, commits, issues and mails by date, authors by id etc.

I agree that it would make sense to order the commit-interaction data in some way - but no idea which way it would make sense here. @Leo-Send @hechtlC any ideas on that? Or comments why ordering might not be a good idea?

authors by id etc.

Thank you very much @maxloeffler for mentioning this! @hechtlC This was what I wanted to mention in our last meeting but did not remember any more: While debugging stuff I noticed that authors are not ordered by name but by id, which made debugging more tedious to me. I wonder why don't sort authors by name? @maxloeffler Could you please figure out how many tests would break if we would order authors by their name?

Regarding update.commit.message.data I found out that when the ordering of commit messages does not align with the ordering of commits that the merge call destroys the ordering of commits. Commit message data is not ordered upon reading so I think it is best to enforce an ordering after the merge call here.

Good question. If merging commit messages does destroy the ordering of commits, we should definitely fix that. Is there any reason why not ordering commit-message data initially? I guess we could make it similar to pasta data. Do we order pasta data initially? If so, I'd suggest to also order commit messages initially. Otherwise I'd go with your suggestion.

@maxloeffler

Copy link
Copy Markdown
Contributor Author

@maxloeffler Could you please figure out how many tests would break if we would order authors by their name?

Its exactly one test in test-read.R that fails.

I guess we could make it similar to pasta data. Do we order pasta data initially?

No, pasta is initially unsorted. Only after pasta data is merged onto the major data sources, sorting of those major sources is reinforced. So lets do the same for commit message data. As we merge commit message data on either commits or commits.unfiltered and both of those are sorted by date, I will use the fixed version for reordering that I introduced in this PR.

@hechtlC

hechtlC commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

@maxloeffler regarding the commit interaction data: There should not be a date field anywhere as you suggested. What do you mean by that? And it should not be sorted.
Regarding the commit messages: Yes please sort the commit data again after merging it, just like the pasta data.

This comment was marked as outdated.

Comment thread tests/test-networks.R Outdated
There are two interesting cases that the codeface data was missing
before. 1) Commits that touch multiple different files / functions, 2)
Commits by different authors that are issued at the exact same time.

This works towards fixing se-sic#284.

Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
Additionally, sort in all cases (even if 'merge' is not called) to
acomodate for unsorted input data.

Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>

Copilot AI left a comment

Copy link
Copy Markdown

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 enhances the codeface data used for testing by introducing two new corner cases and maintaining consistency between proximity and feature commit IDs. The changes improve test coverage by adding scenarios where commits touch multiple files/functions and where different authors commit at the same time.

  • Enhanced codeface test data with corner cases for multiple files/functions per commit and simultaneous commits by different authors
  • Ensured commit ID consistency between proximity and feature data sources
  • Improved data ordering preservation during merge operations to maintain correct chronological sequence

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

File Description
util-read.R Updated copyright year and improved author ordering logic
util-data.R Enhanced merge operations to preserve data ordering when adding commit messages, PaStA, and synchronicity data
tests/test-*.R Updated test expectations to reflect new codeface data with additional commits and corner cases
tests/codeface-data/ Added new commit entries with consistent IDs between proximity and feature data sources
Comments suppressed due to low confidence (1)

util-read.R:528

  • [nitpick] Removing the blank line between the try block and the error check reduces code readability. Consider keeping blank lines to separate logical sections of code.
    ## break if the list of authors is empty

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

@bockthom

Copy link
Copy Markdown
Collaborator

@maxloeffler Thanks for fixing this, looks good now.

Could you please draft the update for the NEWS.md? Thank you!

Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
@bockthom
bockthom merged commit 88356e1 into se-sic:dev Aug 23, 2025
9 checks passed
@bockthom bockthom mentioned this pull request Oct 2, 2025
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.

4 participants