def GetTagsForGPUTest(tags, components):
  """Updates component-based tags for a GPU test.

  Args:
    tags ([str]): Tags that specify the category of the test.
    components (set(str)): The components of a test.
  Returns:
    Alphabetically sorted tags for a test with updated component-based tags.
  """
  new_tags = set([
      t for t in (tags or [])
      if not t.startswith(('watchlist::', 'directory::', 'source::',
                           'parent_component::', 'component::'))
  ])
  new_tags = new_tags.union(
      set(['component::%s' % component for component in components]))
  return sorted(new_tags)