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

fix builds namespace matching #33

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

enoodle
Copy link

@enoodle enoodle commented Jul 11, 2017

@enoodle
Copy link
Author

enoodle commented Jul 11, 2017

The codeclimate issues are not relevant to this PR.

@moolitayer
Copy link

@cben please review and check for implications on your current work

Copy link
Contributor

@cben cben left a comment

Choose a reason for hiding this comment

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

Thanks, especially for the tests 👍 🍾

I prefer this merged first (in case we'll want to backport), I'll rebase #30 on this.

it "handles simple data" do
build_pod = basic_build_pod.dup
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you want .deep_dup (everywhere you .dup), because you're mutating several levels inside.
Could also use .deep_merge.

@enoodle enoodle force-pushed the fix_builds_namespace_matching branch from b526366 to ce779e6 Compare July 11, 2017 09:08
it "links correct build pods to build configurations in same namespace" do
parse_entities('namespace_1', 'namespace_1')
expect(parser.instance_variable_get('@data')[parser.send(:path_for_entity, "build")].first[:build_config]).to eq(
parser.instance_variable_get('@data')[parser.send(:path_for_entity, "build_config")].first
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd hardcode the results of path_for_entity, both for readability and because I prefer concreteness in tests.
LGTM either way.

@enoodle enoodle force-pushed the fix_builds_namespace_matching branch from ce779e6 to 3c92391 Compare July 11, 2017 09:40
@cben
Copy link
Contributor

cben commented Jul 11, 2017

👍 agree that codeclimate issues are irrelevant to this.

@simon3z simon3z added the bug label Jul 11, 2017
@simon3z
Copy link
Contributor

simon3z commented Jul 11, 2017

@enoodle @cben @moolitayer I have the feeling this affects fine/euwe as well. Let's have a BZ.

@miq-bot add_label fine/yes

bc_namespace = build_pod.status.config.try(:namespace)
new_result[:build_config] = @data_index.fetch_path(path_for_entity("build_config"),
:by_namespace_and_name,
bc_namespace, bc_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

@enoodle probably we don't need this indentation (you may even keep a single line).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm moving & reformatting this line anyway in #30 so doesn't matter.

@enoodle
Copy link
Author

enoodle commented Jul 11, 2017

@cben
Copy link
Contributor

cben commented Jul 11, 2017

@miq-bot remove-label bugzilla needed

ping @simon3z

@miq-bot
Copy link
Member

miq-bot commented Jul 11, 2017

Checked commit enoodle@3c92391 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 7 offenses detected

spec/models/manageiq/providers/openshift/container_manager/refresh_parser_spec.rb

@simon3z simon3z merged commit b5f96e0 into ManageIQ:master Jul 11, 2017
@moolitayer moolitayer added this to the Sprint 65 Ending Jul 24, 2017 milestone Aug 9, 2017
@simaishi
Copy link

Fine backport (to manageiq repo) details:

$ git log -1
commit e9977cb3d57b87d7aba709dba7addf0aa6dfdd17
Author: Federico Simoncelli <federico.simoncelli@gmail.com>
Date:   Tue Jul 11 15:27:42 2017 +0100

    Merge pull request #33 from enoodle/fix_builds_namespace_matching
    
    fix builds namespace matching
    (cherry picked from commit b5f96e01870748070b2cd730693dc3c0ffae17dd)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1478558

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.

6 participants