-
Notifications
You must be signed in to change notification settings - Fork 244
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
Reset index when force pushed #3536
Reset index when force pushed #3536
Conversation
Hi @gorkem. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
pkg/sync/adapter.go
Outdated
@@ -76,6 +81,10 @@ func (a Adapter) SyncFiles(syncParameters common.SyncParameters) (isPushRequired | |||
} | |||
} | |||
|
|||
if isForcePush { | |||
//reset the index | |||
util.DeleteIndexFile(pushParameters.Path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please handle the returned error
|
||
// Sync source code to the component | ||
// If syncing for the first time, sync the entire source directory | ||
// If syncing to an already running component, sync the deltas | ||
// If syncing from an odo watch process, skip this step, as we already have the list of changed and deleted files. | ||
if !syncParameters.PodChanged && !pushParameters.ForceBuild && len(pushParameters.WatchFiles) == 0 && len(pushParameters.WatchDeletedFiles) == 0 { | ||
if isWatch && !isForcePush { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update the comments above regarding force pushing for watch
/retest |
Can we include a integration test or a new issue for testing push against restarted pods? |
d79342b
to
293063d
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: girishramnani The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
// apply the glob rules from the .gitignore/.odo file | ||
// and ignore the files on which the rules apply and filter them out | ||
filesChangedFiltered, filesDeletedFiltered := util.FilterIgnores(ret.FilesChanged, ret.FilesDeleted, absIgnoreRules) | ||
// apply the glob rules from the .gitignore/.odo file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be.gitignore/.odoignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Updates syncfiles to reset the index to do a full snycronization when pod has changed, restarted ot doing a forcebuild.
Codecov Report
@@ Coverage Diff @@
## master #3536 +/- ##
==========================================
+ Coverage 45.49% 45.56% +0.06%
==========================================
Files 115 115
Lines 11697 11699 +2
==========================================
+ Hits 5322 5331 +9
+ Misses 5857 5847 -10
- Partials 518 521 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
What type of PR is this?
/kind bug
What does does this PR do / why we need it:
It resets the index for synced files to ensure that all files are synced when a pod is started/restarted or it is force pushed.
Which issue(s) this PR fixes:
Fixes #3479
How to test changes / Special notes to the reviewer:
Instructions are provided on #3479