Skip to content

Automatically clean up book metadata #976

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

Merged
merged 7 commits into from
Jul 10, 2019

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jul 9, 2019

We keep information about which branches contribute to which books but
before this change we didn't automatically remove the metadata when
a branch is no longer involved in building a book we never cleared that
metadata. For the most part this just left lines in a YAML file that
aren't used except when we remove a branch from a book and then re-add
it. In that case since we only use the branch data to figure out if we
should rebuild a book we wouldn't start to build the book when it is
added back unless the branch that it is built from changes. This happened
to us recently so it makes sense to clean up these files automatically
so it never happens again.

Closes #973

@nik9000 nik9000 requested a review from olksdr July 9, 2019 17:53
@nik9000
Copy link
Member Author

nik9000 commented Jul 9, 2019

@olksdr could you have a look at this one please?

# tell if it'll be needed again. It is a problem, but not a big one
# right now.
unless ($allowed_for_repo->{$branch} || $branch =~ /^link-check/) {
say "Pruning for $repo $branch";
Copy link
Member Author

Choose a reason for hiding this comment

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

This is leftover debugging info and I'll remove before committing.

Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

delete $branches->{$branch};
}
}
# Empty can show up because there is a new book that weren't not
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 one not too many here -> book that weren't not

@nik9000
Copy link
Member Author

nik9000 commented Jul 10, 2019

Thanks for reviewing @olksdr !

@nik9000 nik9000 merged commit 93abb12 into elastic:master Jul 10, 2019
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.

Removing a branch from a book doesn't clear its metadata
2 participants