def job_feed(job): """Create the Atom feed for job view. :param job: The job name. :type job: str """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": job}) feed_data = { "alternate_url": FRONTEND_JOB_URL, "cache_key": hashlib.md5(request.url).digest(), "content_links": [ { "href": BUILD_REPORTS_URL, "label": u"Build reports" }, { "href": BOOT_REPORTS_URL, "label": u"Boot reports" } ], "entry_title": FEED_TITLE, "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": FRONTEND_JOB_URL, "host_url": request.host_url, "template_name": "job.html", } feed_data["subtitle"] = u"Latest available jobs for %s" % job feed_data["title"] = \ u"kernelci.org \u2014 Jobs for Tree \u00AB%s\u00BB" % job return feed.create_feed( [("job", job)], feed_data, _get_job_data, _parse_job_results)
def get_boot_board_feed(board): """Create the Atom feed for the boot-board view. :param board: The name of the board. :type board: str """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": board}) feed_data = { "alternate_url": BOOT_COMPLETE_FRONTEND_URL, "cache_key": hashlib.md5(request.url).digest(), "content_links": [ { "href": BOOT_COMPLETE_FRONTEND_URL, "label": u"Boot report details" }, { "href": BASE_URL + u"/boot/%(board)s/", "label": u"Boot reports for board %(board)s" } ], "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": BASE_URL + u"/boot/%(board)s/", "host_url": request.host_url, "template_name": "boot.html", } feed_data["entry_title"] = ( u"%(status)s \u2014 %(lab_name)s \u2013 %(job)s %(kernel)s " + u"%(defconfig_full)s (%(arch)s)") feed_data["subtitle"] = \ u"Latest available boot reports for board %s" % board feed_data["title"] = \ u"kernelci.org \u2014 Boot Reports for Board \u00AB%s\u00BB" % board return feed.create_feed( [ ("board", board), ( "field", ( "_id", "arch", "board", "build_id", "created_on", "defconfig", "defconfig_full", "job", "job_id", "kernel", "lab_name", "status" ) ) ], feed_data, _get_boot_data, _parse_boot_results)
def get_boot_all_job_feed(job): """Create the Atom feed for the boot-all-job view. :param job: The name of the job. :type job: str """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": job}) feed_data = { "alternate_url": BASE_URL + u"/boot/all/job/%(job)s/kernel/%(kernel)s/", "cache_key": hashlib.md5(request.url).digest(), "content_links": [ { "href": BASE_URL + u"/boot/all/job/%(job)s/kernel/%(kernel)s/", "label": u"Boot reports for tree %(job)s - %(kernel)s" } ], "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": BASE_URL + u"/boot/all/job/%(job)s/", "host_url": request.host_url, "template_name": "boot_job_aggregate.html", } feed_data["entry_title"] = ( u"%(kernel)s \u2014 %(failed_boots)s failed, " + u"%(other_boots)s unknown, %(passed_boots)s passed \u2013 " + u"%(total_boots)s total" ) feed_data["subtitle"] = \ u"Latest available boot reports for tree %s" % job feed_data["title"] = \ u"kernelci.org \u2014 Boot Reports for Tree \u00AB%s\u00BB" % job return feed.create_feed( [ ("aggregate", "kernel"), ("job", job), ( "field", ( "created_on", "git_branch", "git_commit", "git_describe", "git_url", "job", "kernel" ) ) ], feed_data, _get_boot_data, _parse_aggregated_boot_results )
def job_branch_feed(job, branch): """Create the Atom feed for job-branch view. :param job: The job name. :type job: str :param branch: The branch name. :type branch: str """ # Replace the ':'' with the '/'' back. branch = branch.replace(":", "/", 1) feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": job}) feed_categories.append({"term": branch}) feed_data = { "alternate_url": FRONTEND_JOB_BRANCH_URL, "branch": branch, "cache_key": hashlib.md5(request.url).digest(), "content_links": [{ "href": BUILD_REPORTS_URL, "label": u"Build reports" }, { "href": BOOT_REPORTS_URL, "label": u"Boot reports" }], "entry_title": FEED_TITLE, "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": FRONTEND_JOB_BRANCH_URL, "host_url": request.host_url, "template_name": "job.html", } feed_data["subtitle"] = \ u"Latest available jobs for %s \u2013 %s" % (job, branch) feed_data["title"] = ( u"kernelci.org \u2014 Jobs for Tree \u00AB%s\u00BB (%s) " % (job, branch)) return feed.create_feed([("job", job), ("git_branch", branch)], feed_data, _get_job_data, _parse_job_results)
def soc_job_feed(soc, job): """Create the Atom feed for soc/job view. :param soc: The soc value. :param job: The job value. """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": soc}) feed_categories.append({"term": job}) feed_data = { "alternate_url": FRONTEND_SOC_JOB_URL, "cache_key": hashlib.md5(request.url).digest(), "content_links": [ { "href": FRONTEND_SOC_JOB_URL, "label": u"SoC boot reports" }, { "href": BOOT_REPORTS_URL, "label": u"Boot reports" }, { "href": FRONTEND_JOB_URL, "label": u"Job details" } ], "entry_title": SOC_KERNEL_TITLE, "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": FRONTEND_SOC_JOB_URL, "host_url": request.host_url, "template_name": "soc-job-kernel.html", } feed_data["subtitle"] = \ u"Latest available kernels tested for %s - %s" % (soc, job) feed_data["title"] = ( u"kernelci.org \u2014 Boot Reports for SoC \u00AB%s\u00BB - %s" % (soc, job)) return feed.create_feed( [ ("aggregate", "kernel"), ("mach", soc), ("job", job) ], feed_data, _get_soc_data, _parse_soc_results )
def soc_job_feed(soc, job): """Create the Atom feed for soc/job view. :param soc: The soc value. :param job: The job value. """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": soc}) feed_categories.append({"term": job}) feed_data = { "alternate_url": FRONTEND_SOC_JOB_URL, "cache_key": hashlib.md5(request.url).digest(), "content_links": [{ "href": FRONTEND_SOC_JOB_URL, "label": u"SoC boot reports" }, { "href": BOOT_REPORTS_URL, "label": u"Boot reports" }, { "href": FRONTEND_JOB_URL, "label": u"Job details" }], "entry_title": SOC_KERNEL_TITLE, "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": FRONTEND_SOC_JOB_URL, "host_url": request.host_url, "template_name": "soc-job-kernel.html", } feed_data["subtitle"] = \ u"Latest available kernels tested for %s - %s" % (soc, job) feed_data["title"] = ( u"kernelci.org \u2014 Boot Reports for SoC \u00AB%s\u00BB - %s" % (soc, job)) return feed.create_feed([("aggregate", "kernel"), ("mach", soc), ("job", job)], feed_data, _get_soc_data, _parse_soc_results)
def get_boot_all_lab_feed(lab_name): """Create the Atom feed for the boot-lab view. :param lab_name: The name of the lab. :type lab_name: str """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": lab_name}) feed_data = { "alternate_url": BOOT_COMPLETE_FRONTEND_URL, "cache_key": hashlib.md5(request.url).digest(), "content_links": [{ "href": BOOT_COMPLETE_FRONTEND_URL, "label": u"Boot report details" }, { "href": BASE_URL + u"/boot/all/lab/%(lab_name)s/", "label": u"Boot reports for lab %(lab_name)s" }, { "href": BASE_URL + u"/build/%(job)s/kernel/%(kernel)s/", "label": u"Build reports" }], "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": BASE_URL + u"/boot/all/lab/%(lab_name)s/", "host_url": request.host_url, "template_name": "boot.html", } feed_data["entry_title"] = ( u"%(status)s \u2014 %(board)s \u2013 %(job)s %(kernel)s " + u"%(defconfig_full)s (%(arch)s)") feed_data["subtitle"] = \ u"Latest available boot reports for lab %s" % lab_name feed_data["title"] = \ u"kernelci.org \u2014 Boot Reports for Lab \u00AB%s\u00BB" % lab_name return feed.create_feed([("lab_name", lab_name)], feed_data, _get_boot_data, _parse_boot_results)
def job_branch_feed(job, branch): """Create the Atom feed for job-branch view. :param job: The job name. :type job: str :param branch: The branch name. :type branch: str """ # Replace the ':'' with the '/'' back. branch = branch.replace(":", "/", 1) feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": job}) feed_categories.append({"term": branch}) feed_data = { "alternate_url": FRONTEND_JOB_BRANCH_URL, "branch": branch, "cache_key": hashlib.md5(request.url).digest(), "content_links": [ { "href": BUILD_REPORTS_URL, "label": u"Build reports" }, { "href": BOOT_REPORTS_URL, "label": u"Boot reports" } ], "entry_title": FEED_TITLE, "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": FRONTEND_JOB_BRANCH_URL, "host_url": request.host_url, "template_name": "job.html", } feed_data["subtitle"] = \ u"Latest available jobs for %s \u2013 %s" % (job, branch) feed_data["title"] = ( u"kernelci.org \u2014 Jobs for Tree \u00AB%s\u00BB (%s) " % (job, branch)) return feed.create_feed( [("job", job), ("git_branch", branch)], feed_data, _get_job_data, _parse_job_results)
def get_boot_all_lab_feed(lab_name): """Create the Atom feed for the boot-lab view. :param lab_name: The name of the lab. :type lab_name: str """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": lab_name}) feed_data = { "alternate_url": BOOT_COMPLETE_FRONTEND_URL, "cache_key": hashlib.md5(request.url).digest(), "content_links": [ { "href": BOOT_COMPLETE_FRONTEND_URL, "label": u"Boot report details" }, { "href": BASE_URL + u"/boot/all/lab/%(lab_name)s/", "label": u"Boot reports for lab %(lab_name)s" }, { "href": BASE_URL + u"/build/%(job)s/kernel/%(kernel)s/", "label": u"Build reports" } ], "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": BASE_URL + u"/boot/all/lab/%(lab_name)s/", "host_url": request.host_url, "template_name": "boot.html", } feed_data["entry_title"] = ( u"%(status)s \u2014 %(board)s \u2013 %(job)s %(kernel)s " + u"%(defconfig_full)s (%(arch)s)") feed_data["subtitle"] = \ u"Latest available boot reports for lab %s" % lab_name feed_data["title"] = \ u"kernelci.org \u2014 Boot Reports for Lab \u00AB%s\u00BB" % lab_name return feed.create_feed( [("lab_name", lab_name)], feed_data, _get_boot_data, _parse_boot_results)
def job_feed(job): """Create the Atom feed for job view. :param job: The job name. :type job: str """ feed_categories = copy.deepcopy(FEED_CATEGORIES) feed_categories.append({"term": job}) feed_data = { "alternate_url": FRONTEND_JOB_URL, "cache_key": hashlib.md5(request.url).digest(), "content_links": [{ "href": BUILD_REPORTS_URL, "label": u"Build reports" }, { "href": BOOT_REPORTS_URL, "label": u"Boot reports" }], "entry_title": FEED_TITLE, "feed_categories": feed_categories, "feed_url": request.url, "frontend_url": FRONTEND_JOB_URL, "host_url": request.host_url, "template_name": "job.html", } feed_data["subtitle"] = u"Latest available jobs for %s" % job feed_data["title"] = \ u"kernelci.org \u2014 Jobs for Tree \u00AB%s\u00BB" % job return feed.create_feed([("job", job)], feed_data, _get_job_data, _parse_job_results)