1# Copyright 2020 Google Inc. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15################################################################################ 16"""Cloud datastore entity classes.""" 17from google.cloud import ndb 18 19 20# pylint: disable=too-few-public-methods 21class Project(ndb.Model): 22 """Represents an integrated OSS-Fuzz project.""" 23 name = ndb.StringProperty() 24 schedule = ndb.StringProperty() 25 project_yaml_contents = ndb.TextProperty() 26 dockerfile_contents = ndb.TextProperty() 27 28 29# pylint: disable=too-few-public-methods 30class GithubCreds(ndb.Model): 31 """Represents GitHub credentials.""" 32 client_id = ndb.StringProperty() 33 client_secret = ndb.StringProperty() 34 35 36# pylint: disable=too-few-public-methods 37class BuildsHistory(ndb.Model): 38 """Container for build history of projects.""" 39 build_tag = ndb.StringProperty() 40 project = ndb.StringProperty() 41 build_ids = ndb.StringProperty(repeated=True) 42 43 44class LastSuccessfulBuild(ndb.Model): 45 """Container for storing last successful build of project.""" 46 build_tag = ndb.StringProperty() 47 project = ndb.StringProperty() 48 build_id = ndb.StringProperty() 49 finish_time = ndb.StringProperty() 50