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

Decision: allow singleton test fixtures #559

Merged
merged 9 commits into from
Aug 12, 2022
Merged

Decision: allow singleton test fixtures #559

merged 9 commits into from
Aug 12, 2022

Conversation

ace-n
Copy link
Contributor

@ace-n ace-n commented Jul 7, 2022

This codifies the trend Emblem has been following + previous conversations around this topic.

Googlers: this fixes b/233379931

@ace-n ace-n requested a review from grayside July 7, 2022 00:45
@ace-n ace-n requested a review from a team as a code owner July 7, 2022 00:45
@github-actions github-actions bot added component: demo services Related to interactive learning using the app. documentation Improvements or additions to documentation labels Jul 7, 2022
@grayside grayside added do not merge Indicates a pull request not ready for merge, due to either quality or timing. needs discussion and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Jul 7, 2022
@grayside
Copy link
Collaborator

grayside commented Jul 7, 2022

This seems like a proposal to codify our implicit decisions, but I find the cattle/pet terminology doesn't match my perspective so I think we need more discussion before this can move forward.

The Cattle/Pet metaphor as I understand it is about automation & ephemerality vs. hand-managed and urgently protected.

I see our reuse of projects as primarily a concession to security policies, user convenience, and limitations of terraform, but I don't think of them as pets.

I consider it a team maintenance bug (as opposed to an Emblem project bug) that we don't have something in place to guide the project creation process more clearly, and provide some kind of consistent configuration oversight.

@ace-n
Copy link
Contributor Author

ace-n commented Jul 11, 2022

TODO we need to document:

docs/decisions/2022-07-pet-test-fixtures.md Outdated Show resolved Hide resolved
docs/decisions/2022-07-pet-test-fixtures.md Outdated Show resolved Hide resolved
@@ -0,0 +1,73 @@
# Allow "pet" test fixtures
Copy link
Collaborator

Choose a reason for hiding this comment

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

Because this is not just a point in time decision, but an ongoing guideline for related decisions in the future, it would be good to add a reference to this decision record as a design philosophy: https://github.com/GoogleCloudPlatform/emblem/blob/main/CONTRIBUTING.md#design--project-philosophy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #574

docs/decisions/2022-07-pet-test-fixtures.md Outdated Show resolved Hide resolved
Comment on lines 33 to 36
### Emblem is owned by a single team
While Emblem is designed with a service-oriented architecture, all of Emblem's components are (currently) owned by the same team.

> Consequently, optimizing our test fixtures for multi-team collaboration isn't as important as minimizing test development/maintenance costs.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure I follow this. Is the idea that in a multi-team scenario, additional automation of test fixtures is more reasonable to avoid duplicating work? If so I think this needs to be more explicit.

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 was thinking moreso large numbers of parallel test runs; I added that here to be explicit.


We'll use _programmatically provisioned_ fixture resources wherever practical. These resources can be made ephemeral ("cattle") if necessary.

In some situations, _manual provisioning_ of centralized ("pet") resources will be simpler to implement (if not outright required). Usually, these resources **cannot** be made ephemeral and will need to be reused between test runs.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be a bit more specific so it's more of an actionable guideline in the future? Which Cloud resources can be reusable instead of ephemeral?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some examples, PTAL.


### Revisiting this Decision

If the organizational structure behind Emblem changes (for example, Emblem comes under the collective ownership of multiple different teams), we will re-evaluate this decision.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Organizational change is just one of several reasons to revisit. Really it's about maintenance overhead. If we find the maintenance overhead of permanent resources grows higher than the cost of automation, we'd revisit. The cost of automation might also go down over time, such as through the introduction of terraform state to make teardown operations simpler (#97)

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 agree in principle, but I find it hard to imagine such a maintenance cost > cost of automation scenario that doesn't involve a change in org structure.

Nevertheless, I reworded this section - so PTAL. 👍

@github-actions github-actions bot added the component: experimental Related to experiments & early research. label Jul 14, 2022
@github-actions github-actions bot removed the component: experimental Related to experiments & early research. label Jul 14, 2022
@ace-n ace-n requested a review from grayside July 15, 2022 00:10
@ace-n ace-n changed the title Decision: allow pet test fixtures Decision: allow singleton test fixtures Jul 29, 2022
Copy link
Collaborator

@grayside grayside 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 making changes to this proposed decision record. I think you've understood what we talked about outside the PR.

My primary remaining feedback is more subtle: we're not using fixed test resources as a design philosophy, parallelized tests are not outside scope. We've made a decision to accept fixed resources of specific kinds and not pursue the engineering for something more robust because we don't have resources to do so without postponing higher priorities.

## Constraints

### Some resources MUST be singletons
While most of Emblem's Google Cloud resources are provisioned programmatically using Terraform, some (such as the Google Cloud projects themselves) are currently intended to be provisioned manually.
Copy link
Collaborator

Choose a reason for hiding this comment

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

non-blocking: This could be improved by explaining "why". I believe the answer is a blend:

  • Because these things were prototyped in this way and the engineering investment to generalize from the prototype wasn't made
  • Because organization policy constraints make spinning up ad hoc projects challenging.

Copy link
Contributor Author

@ace-n ace-n Aug 2, 2022

Choose a reason for hiding this comment

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

I would argue it's more the latter - the former is pretty easy to do IMO, while the latter is largely (for now) out of our control.

(In fact, I had done it that way in an earlier prototype! 🙂 )

docs/decisions/2022-07-test-fixtures.md Show resolved Hide resolved
docs/decisions/2022-07-test-fixtures.md Outdated Show resolved Hide resolved
docs/decisions/2022-07-test-fixtures.md Outdated Show resolved Hide resolved

### Revisiting this Decision

Currently, the ongoing cost of maintaining long-lived resources is very low. Even though "pluralizing" these resources is likely a _one-time_ cost, the core Emblem team doesn't believe that cost is justified.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another instance of the discussion above, it's about relative prioritization and limited time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworded, PTAL.

@ace-n ace-n requested a review from grayside August 2, 2022 04:34
grayside
grayside previously approved these changes Aug 11, 2022
@ace-n ace-n added the automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit label Aug 11, 2022
@gcf-merge-on-green gcf-merge-on-green bot dismissed grayside’s stale review August 11, 2022 18:38

This review does not reference the most recent commit, and you are using the secure version of merge-on-green. Please re-review the most recent commit.

@grayside grayside added automerge Summon MOG for automerging and removed needs discussion automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit labels Aug 11, 2022
@ace-n ace-n self-assigned this Aug 11, 2022
@gcf-merge-on-green
Copy link

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Summon MOG for automerging label Aug 12, 2022
@grayside grayside added the automerge Summon MOG for automerging label Aug 12, 2022
@gcf-merge-on-green
Copy link

Merge-on-green is not authorized to push to this branch. Visit https://help.github.com/en/github/administering-a-repository/enabling-branch-restrictions to give gcf-merge-on-green permission to push to this branch.

@ace-n ace-n merged commit d55b6ca into main Aug 12, 2022
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Summon MOG for automerging label Aug 12, 2022
@ace-n ace-n deleted the pet-fixtures branch August 12, 2022 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: demo services Related to interactive learning using the app. documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants