Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cherry-picker: Remove BACKPORT_COMPLETE. UNSET state after finished. #315

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

Merged
merged 10 commits into from
Mar 17, 2019

Conversation

Mariatta
Copy link
Member

No description provided.

@Mariatta
Copy link
Member Author

@webknjaz @asvetlov can you take a look. miss-islington is seeing the "BACKPORT_COMPLETE" status, but couldn't continue because it is not an allowed state. I think it should be an allowed state, or did you have different expectation.

@webknjaz
Copy link
Contributor

Checking it now.

@webknjaz
Copy link
Contributor

@Mariatta I expected that state would be reset if everything is completed successfully. How about calling reset_state() after line 391 instead?

@webknjaz
Copy link
Contributor

Any non-allowed states are supposed idicate that something went wrong.

@Mariatta Mariatta changed the title Cherry-picker: make BACKPORT_COMPLETE an allowed state Cherry-picker: Remove BACKPORT_COMPLETE. UNSET state after finished. Mar 15, 2019
@Mariatta
Copy link
Member Author

Ok I've removed BACKPORT_COMPLETE. unset will be called instead, and using the UNSET state.

@Mariatta
Copy link
Member Author

uugh don't know what's the deal with travis 😟 Tests-passing-locally-for-meℒ️

@webknjaz
Copy link
Contributor

Oh, that's weird... Did you run all tests locally or just related?

@Mariatta
Copy link
Member Author

Hmm I ran everything pytest cherry_picker/test.py -v in the cherry_picker directory

@webknjaz
Copy link
Contributor

I checked this branch locally as well and it passes.

@webknjaz
Copy link
Contributor

@Mariatta just to be on the safe side, could you please clear the cache in Travis CI? It's here https://travis-ci.org/python/core-workflow/caches

@Mariatta
Copy link
Member Author

I've cleared cache and restart the build, still no luck πŸ€• Anyone else can try this locally?

@Mariatta Mariatta added the black out Runs black on PR label Mar 15, 2019
@black-out
Copy link

black-out bot commented Mar 15, 2019

πŸπŸŒšπŸ€– @Mariatta, I've formatted these files using black:

  • cherry_picker/cherry_picker/cherry_picker.py
  • cherry_picker/cherry_picker/test.py
    (I'm a bot πŸ€–)

@black-out black-out bot removed the black out Runs black on PR label Mar 15, 2019
@webknjaz
Copy link
Contributor

@Mariatta could you please merge #311 and then rebase this one? The test suite didn't use new fixtures in some tests and it could improve the situation, I think (hope).

@webknjaz
Copy link
Contributor

webknjaz commented Mar 15, 2019

@Mariatta I know what the problem is! πŸŽ‰

So git log -r dc896437c8efe5a4a5dfa50218b7a6dc0cbe2598 is executed to check the repo.
But Travis CI only gets 50 last commits by default, not the whole tree. So this commit is now further than 50 commits and the check fails.

@webknjaz
Copy link
Contributor

Solutions:

  1. Change the sha in config to something newer
  2. Find &install-and-test-cherry-picker on line 28 in .travis.yml and extend the mapping to contain Git config adjustment:
- &install-and-test-cherry-picker
  ...
  git:
    depth: 200
  ...

@Mariatta Mariatta added the black out Runs black on PR label Mar 16, 2019
@black-out
Copy link

black-out bot commented Mar 16, 2019

πŸπŸŒšπŸ€– @Mariatta, I've formatted these files using black:

  • cherry_picker/cherry_picker/test.py
    (I'm a bot πŸ€–)

@black-out black-out bot removed the black out Runs black on PR label Mar 16, 2019
],
)
@mock.patch("os.path.exists")
@mock.patch("cherry_picker.cherry_picker.validate_sha")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

Copy link
Member Author

Choose a reason for hiding this comment

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

These tests aren't testing validate_sha itself, but the other functionalities. I think it is ok to be mocked.

Copy link
Contributor

Choose a reason for hiding this comment

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

I disagree: more integrated tests is better. Testing a combination of things makes it all more robust. Especially when it costs nothing.
As in

Copy link
Contributor

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

I think that mocking validate_sha is wrong. This way you'll just completely disable testing of the specific code path. It doesn't cure the root of the issue but only symptoms. Along with that, it makes the project vulnerable to regressions.

@Mariatta
Copy link
Member Author

hm, but changing it to recent sha also only delays the problem, same issue will happen again in the future.

@Mariatta Mariatta added the black out Runs black on PR label Mar 17, 2019
@black-out
Copy link

black-out bot commented Mar 17, 2019

πŸπŸŒšπŸ€– @Mariatta, I've formatted these files using black:

  • cherry_picker/cherry_picker/test.py
    (I'm a bot πŸ€–)

@black-out black-out bot removed the black out Runs black on PR label Mar 17, 2019
@webknjaz
Copy link
Contributor

@Mariatta I think you should just make git clone deeper. Or if you're worried about the delay, it's possible to disable --depth= in Travis CI so that it'd clone the whole thing.

@Mariatta Mariatta added the black out Runs black on PR label Mar 17, 2019
@black-out
Copy link

black-out bot commented Mar 17, 2019

πŸπŸŒšπŸ€– @Mariatta, I've formatted these files using black:

  • cherry_picker/cherry_picker/test.py
    (I'm a bot πŸ€–)

@black-out black-out bot removed the black out Runs black on PR label Mar 17, 2019
@Mariatta
Copy link
Member Author

Thanks, I've disabled git depth in travis CI and reverted the mocks.

@webknjaz
Copy link
Contributor

@Mariatta great!

P.S. One small feedback about black out: as you can see it messes up unrelated stuff making it impossible to track down (by looking at diff) what was the intended change in the PR. It's not completely non-atomic. I'd recommend applying black to the project separately and then when PR is on top of that, using back will only generate related changes :)

@Mariatta Mariatta merged commit 04b6587 into master Mar 17, 2019
@Mariatta
Copy link
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants