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

Adding support for aliases #296

Merged
merged 18 commits into from
Feb 7, 2018
Merged

Adding support for aliases #296

merged 18 commits into from
Feb 7, 2018

Conversation

dbemiller
Copy link
Contributor

@dbemiller dbemiller commented Jan 25, 2018

This fixes #11.

Adding alias support to the OpenRTB endpoints. For a description of the feature, see the issue + docs. if those aren't clear enough, let me know so that I can make them better for everyone else.

@ghost ghost assigned dbemiller Jan 25, 2018
@ghost ghost added the in progress label Jan 25, 2018
@dbemiller dbemiller requested a review from hhhjort January 25, 2018 15:48
@dbemiller dbemiller added the needs docs Docs are required for this PR or Issue label Jan 25, 2018
liveAdapters[i] = a
i++
}
// Randomize the list of adapters to make the auction more fair
randomizeList(liveAdapters)
// Process the request to check for targeting parameters.
var targData *targetData = nil
var targData *targetData
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know the old and the new lines are functionally the same. Is there any advantage to not explicitly declaring the value of the variable to be the null value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not that I know of, no.

I've been trying out visual studio and it complains about those lines... I think cause it runs golint in the background. I really have no preference either way.

hhhjort
hhhjort previously approved these changes Jan 26, 2018
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

Seems to be a good PR. A lot of tweaks needed to implement Aliases, but I haven't found any real issues with this code.

@dbemiller dbemiller removed the needs docs Docs are required for this PR or Issue label Jan 26, 2018
@dbemiller dbemiller assigned hhhjort and unassigned dbemiller and ndhimehta Jan 26, 2018
hhhjort
hhhjort previously approved these changes Jan 26, 2018
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

Yay documentation. Docs look reasonable.

Nothing else has changed.

@dbemiller
Copy link
Contributor Author

dbemiller commented Feb 7, 2018

5 days with no changes requested by the second reviewer... merging this, per the standard process.

@cindyhere33 If you get around to it at some point and find changes, please open issues (or submit new PRs) for them.

@dbemiller dbemiller merged commit e9b7bd6 into master Feb 7, 2018
@dbemiller dbemiller deleted the add-alias-support branch February 7, 2018 19:28
return fmt.Errorf("request.ext.prebid.aliases.%s refers to unknown bidder: %s", thisAlias, coreBidder)
}
if thisAlias == coreBidder {
return fmt.Errorf("request.ext.prebid.aliases.%s defines a no-op alias. Choose a different alias, or remove this entry.", thisAlias)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this necessarily return an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

definitely debatable... I'm not 100% sure.

My thoughts were: "If they sent this, we would ignore it. If we ignore it, then they'll get better performance (smaller I/O) if they don't send it. Let's encourage that."

I sorta doubt anyone will care either way, though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is debatable. I was thinking there is one case that we would probably want to return an error, but this wouldn't catch it. Do we want to flag when someone aliases one core bidder to another? Like appnexus=rubicon? I don't really see a use case to do this, and if someone does it is quite likely that it will just cause confusion. Perhaps we want to check for this case as well?

We could use a method to pass back warnings, so we can flag curious things like this without invalidation the entire bid request for the bidder. Developers could then see the message when they are trying to debug why the auction isn't happening as they expected. But that is probably out of scope for this PR.

Copy link
Contributor Author

@dbemiller dbemiller Feb 8, 2018

Choose a reason for hiding this comment

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

Yeah, the appnexus=rubicon one is a good case. I definitely did consider making that an error... but that would actually make every new Bidder a breaking change. Today, publishers could alias foo=appnexus, and tomorrow, someone could submit a new Bidder with the name foo. It's very unlikely, but.... if this is an error, then that's technically a breaking change.

So... instead I made appnexus=rubicon legal, and defined the API so that aliases take precedence over "core" bidders. There's a section about it in the aliases docs... but maybe it's worth highlighting? With a "NOTE" or "WARNING" or something like that.

If an alias overlaps with a core Bidder's name, then the alias will take precedence. This prevents breaking API changes as new Bidders are added to the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've been toying with the idea of "warn, but execute the auction anyway" too... but I lean moderately against it.

Devs are more likely to miss or ignore 2xx responses with an error message stuffed into them than they are 4xx's. If the error message is good, it takes like 30 seconds to fix.

In some cases it's obvious what the user "meant" and we can run an appropriate auction, but in other cases it's not. It's like a deer in a thicket; you can walk in easily, but you're likely to get your antlers tangled, and then it'll be impossible to escape. And if they miss the warnings, and the auction doesn't behave exactly like they expect, they'll log issues about it... which we'll then have to debug.

I'd just rather not go down that road.

katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 1, 2020
* Added alias support to the request validation and bid preprocessing. No new unit tests yet.

* Fixed some lint errors.

* Added aliases as a return value from cleanOpenRTBRequests.

* Added alias support to the core auction logic.

* Fixed a bug with the timeout computation.

* Made sure that the core biddername gets used for operational metrics.

* Fixed a unit test which was broken after the changes.

* Cleaner, simpler parse/validate method.

* Added some tests, and fixed some bugs.

* Added one more use case, and tightened the input validation a bit.

* Updated the endpoint docs.

* Better alias docs. Fixed the header mismatches.
katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 2, 2020
* Added alias support to the request validation and bid preprocessing. No new unit tests yet.

* Fixed some lint errors.

* Added aliases as a return value from cleanOpenRTBRequests.

* Added alias support to the core auction logic.

* Fixed a bug with the timeout computation.

* Made sure that the core biddername gets used for operational metrics.

* Fixed a unit test which was broken after the changes.

* Cleaner, simpler parse/validate method.

* Added some tests, and fixed some bugs.

* Added one more use case, and tightened the input validation a bit.

* Updated the endpoint docs.

* Better alias docs. Fixed the header mismatches.
StarWindMoonCloud pushed a commit to ParticleMedia/prebid-server that referenced this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Support for Appnexus Aliases
6 participants