Skip to content

Fix list ports with multiple fixedip parameters#2806

Merged
pierreprinetti merged 2 commits intogophercloud:masterfrom
shiftstack:list-ports-by-fixed-ip
Oct 23, 2023
Merged

Fix list ports with multiple fixedip parameters#2806
pierreprinetti merged 2 commits intogophercloud:masterfrom
shiftstack:list-ports-by-fixed-ip

Conversation

@mdbooth
Copy link
Copy Markdown
Contributor

@mdbooth mdbooth commented Oct 12, 2023

Fixes #2807

Links to the line numbers/files in the OpenStack source code that support the
code in this PR:

Absolutely no idea! I can't even find the entry point for the ports api handler. This is reverse engineered from the behaviour from the cli client, which works.

@mdbooth
Copy link
Copy Markdown
Contributor Author

mdbooth commented Oct 12, 2023

I'm anticipating that "Subnet ID and IP Address" will fail. If it does I'll open an issue.

@github-actions github-actions bot added the semver:patch No API change label Oct 12, 2023
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 12, 2023

Coverage Status

coverage: 77.442% (+0.001%) from 77.441% when pulling 3076b79 on shiftstack:list-ports-by-fixed-ip into d00e5c5 on gophercloud:master.

@mdbooth mdbooth force-pushed the list-ports-by-fixed-ip branch from 6d321fd to 6a7ae90 Compare October 12, 2023 10:20
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels Oct 12, 2023
@mdbooth
Copy link
Copy Markdown
Contributor Author

mdbooth commented Oct 12, 2023

Test failed successfully 😁

@github-actions github-actions bot removed the semver:patch No API change label Oct 12, 2023
@mdbooth mdbooth changed the title Add acceptance tests for list ports Fix list ports with multiple fixedip parameters Oct 12, 2023
@github-actions github-actions bot added the semver:major Breaking change label Oct 12, 2023
@mdbooth
Copy link
Copy Markdown
Contributor Author

mdbooth commented Oct 12, 2023

Semver arguments:

It doesn't affect semver at all because it's a bugfix. It previously did not work, now it works.

A user using gophercloud correctly would previously get no returned ports, where now they get returned ports. This is a breaking change in the previous behaviour of the gophercloud API, so is semver:major.

While the latter may be technically correct, I believe the former is more useful: it's just a bugfix.

@dulek
Copy link
Copy Markdown
Contributor

dulek commented Oct 12, 2023

/lgtm

@pierreprinetti
Copy link
Copy Markdown
Member

WRT semver: bug fixes can absolutely be major. If the same function call returns different results before and after given the same environment, then it’s major. There is a 100% chance that someone somewhere for some wicked reason is relying on the old broken behaviour.
This PR is another good reason to issue v2!

expectedPorts: 1,
},
} {
t.Run(fmt.Sprintf("List ports by %s", tt.name), func(t *testing.T) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

U.U.o.fmt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What does that mean?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Useless Use of fmt 😁

}
logPorts()
t.Fatalf("Returned ports did not contain expected port")
}()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lol why

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oh I get it. you're saving us one "found" bool

Copy link
Copy Markdown
Contributor Author

@mdbooth mdbooth Oct 12, 2023

Choose a reason for hiding this comment

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

Yeah, the early return. I think the first version of this was returning something, which is normally why I write this. I can change it if it's majorly objectionable.

@mdbooth
Copy link
Copy Markdown
Contributor Author

mdbooth commented Oct 12, 2023

@pierreprinetti Did you need any changes before approval?

@pierreprinetti
Copy link
Copy Markdown
Member

@pierreprinetti Did you need any changes before approval?

Not on my side.

Copy link
Copy Markdown
Member

@pierreprinetti pierreprinetti left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this, LGTM.

@pierreprinetti pierreprinetti merged commit 9934fc8 into gophercloud:master Oct 23, 2023
@pierreprinetti pierreprinetti deleted the list-ports-by-fixed-ip branch October 23, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:major Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid query generated for port list with fixed IPs

4 participants