Skip to content

Conversation

@braydonk
Copy link
Contributor

The common package with a bunch of unrelated code is an undesirable pattern long term. Since all the code in common is currently related to metadata, I have changed the package from common to metadata. While I was there, I also removed the requirement for integration_test build tags from everything other than the actual files that contain integration tests.

braydonk added 2 commits July 29, 2022 17:52
The pattern of having a `common` package with a bunch of random
functions thrown in is largely undesirable from a code quality
standpoint. All the code presently in `common` however was related to
metadata, so I renamed the package to `metadata` so no one will be
tempted to throw unrelated code in there.

While I was at it, I also removed the requirement for the integration_test build tag, since it wasn't really necessary for this code.
It also was unnecessary for the integration_test tag to be applied to
this package. It really is only important for the tag to be on the test
files.
The init function was being called erroneously, which would fail when
the environment does not contain Cloud Monitoring credentials. Instead
of an init, refactor it into a function that does the same thing and is
called at the beginning of the program.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration_test
Copy link
Contributor

Choose a reason for hiding this comment

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

probably want to put this back because it's causing unit tests to fail (more init() stuff)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I'll do that. I wish we could refactor the package to not use the init() but it's way too big to do in this PR

@braydonk braydonk merged commit a7cff81 into master Jul 29, 2022
@braydonk braydonk deleted the braydonk-fix-common branch August 10, 2022 13:37
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.

3 participants