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

Reset index when force pushed #3536

Merged

Conversation

gorkem
Copy link
Contributor

@gorkem gorkem commented Jul 9, 2020

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 9, 2020
@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. Required by Prow. label Jul 9, 2020
@openshift-ci-robot
Copy link
Collaborator

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@amitkrout
Copy link
Contributor

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. Required by Prow. labels Jul 9, 2020
@@ -76,6 +81,10 @@ func (a Adapter) SyncFiles(syncParameters common.SyncParameters) (isPushRequired
}
}

if isForcePush {
//reset the index
util.DeleteIndexFile(pushParameters.Path)
Copy link
Contributor

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 {
Copy link
Contributor

@mik-dass mik-dass Jul 10, 2020

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

@kadel
Copy link
Member

kadel commented Jul 10, 2020

/retest

@mik-dass
Copy link
Contributor

mik-dass commented Jul 10, 2020

Can we include a integration test or a new issue for testing push against restarted pods?

@gorkem gorkem force-pushed the force-push-reset branch 2 times, most recently from d79342b to 293063d Compare July 13, 2020 14:04
@girishramnani
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Jul 15, 2020
// 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
Copy link
Contributor

@mik-dass mik-dass Jul 15, 2020

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

Copy link
Contributor

Choose a reason for hiding this comment

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

addressed this in this PR #3614
if there is nothing else wrong them can you please lgtm @mik-dass ?

Copy link
Contributor

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
Copy link

codecov bot commented Jul 21, 2020

Codecov Report

Merging #3536 into master will increase coverage by 0.06%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pkg/sync/adapter.go 80.99% <81.81%> (-1.37%) ⬇️
pkg/sync/sync.go 52.47% <0.00%> (+8.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c2c609...41a501c. Read the comment docs.

Copy link
Contributor

@mik-dass mik-dass left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 22, 2020
@openshift-merge-robot openshift-merge-robot merged commit a95eef9 into redhat-developer:master Jul 22, 2020
@gorkem gorkem deleted the force-push-reset branch July 22, 2020 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. Required by Prow. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odo watch deletes all files
7 participants