#1651: push and commit status.json files to ide-urls-status after running the URL update worklfow#2003
Conversation
…s to the new repo ide-urls-status
Coverage Report for CI Build 28159637210Coverage decreased (-0.1%) to 71.231%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions71 previously-covered lines in 4 files lost coverage.
Coverage Stats💛 - Coveralls |
tineff96
left a comment
There was a problem hiding this comment.
I tested the workflow end-to-end in a fork.
Test setup:
Created a test branch (test/2003-test-branch) in my fork:
tineff96/IDEasy
tineff96/ide-urls
tineff96/ide-urls-status
Adapted the workflow in tineff96/IDEasy to run against the test branch (test/2003-test-branch)
Executed the workflow based on the provided template
(reference run: https://github.com/AdemZarrouki/IDEasy/actions/runs/26902445623)
Result:
The migration of status.json files from ide-urls to ide-urls-status worked as expected.
The workflow correctly commits:
status.jsonfiles are committed toide-urls-status- all other files are committed to
ide-urls
No unexpected files were committed
Important notes for reviewers / future testers:
Setting up the test environment is slightly non-trivial because it requires:
Forks of both repositories (ide-urls and ide-urls-status)
Adjusting the workflow to use the test branch
You must define the following secrets for commits to work:
ACTION_PUSH_TOKEN
BUILD_USER
BUILD_USER_EMAIL
Without BUILD_USER and BUILD_USER_EMAIL, the commit step will fail.
Conclusion:
From my perspective, the implementation behaves correctly and is ready for review.
There was a problem hiding this comment.
@AdemZarrouki thanks for your PR.
Are you aware that the existing code is not only writing the status.json files but also reading them and making choices depending on their content?
IMHO you are currently cloning both repos side-by-side and then running the UpdateInitiator that will not find any status.json without modifying the Java code when they get removed from the ide-urls repo.
I would have expected that you change the Java code to read and write the status.json files now from the separate directory.
If you rather want to do that in the workflow that may also be possible but then you also have to first delete all status.json files from ide-urls anfd then copy them from the new repo before you run the java code. After that you would then move them back and and ensure no status.json remains in ide-urls (what would automatically do the cleanup and delete all these files so we could avoid extra PRs for ide-urls).
However, things to consider:
- Testing workflows is really hard and therefore we should prefer to do as much code in Java and as little in workflows
- I would rather consider this rsync copying, etc. kind of hackish. In the end we have two git repos and a Java process to read and update the data and after that we want to push the changes. When you solve it in Java it IMHO becomes cleaner and the workflow stays shorter and easier to test and understand.
|
@hohwille thanks for the detailed review. So my idea was to avoid the java code change and do instead the changes in the workflow file as this requires less effort, and also i tried to test the workflow on a test branch many times to ensure that the changes are correct. So regarding this:
But if you prefer to change the code so that UpdateInitiator accepts both ide-urls and ide-urls-status, we can do that. |
This PR fixes #1651
Implemented changes:
update-urls.ymlto commit and pushstatus.jsonfiles to repoide-urls-statusstatus.jsonshould not be pushed toide-urlsACTION_PUSH_TOKENso that it have access to the new create repoide-urls-status. This need to be done by @hohwille as he has access to that functionality.status.jsonfiles fromide-urls(will be done in Remove status.json from ide-urls after migration #2021).Testing instructions
Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:
update-urls.ymlto include your test branch. A workflow example was created and it successfully updates bothide-urlsandide-urls-status. https://github.com/AdemZarrouki/IDEasy/actions/runs/26902445623ACTION_PUSH_TOKENand activate the URL Update workflow in your fork.Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internal